<template>
  <div class="app-container">
    <div class="app-box">
      <div class="p-detail">
        <p style='position:relative' class="p_title">
          <i class="iconfont icon-baoxianchanpin"></i>
          <span class="set10">{{info.batchName}}</span>
          <span class="add" v-if='info.isReward'>奖励</span>
          <span class="state state1" v-if='info.state==0'>编辑中</span>
          <span class="state state2" v-else-if='info.state==3'>生效中</span>
          <span class="state state3" v-else-if='info.state==4'>已过期</span>
          <span class="state state4" v-else-if='info.state==1'>待审批</span>
          <span class="state state5" v-else-if='info.state==5'>已驳回</span>
          <span class="state state6" v-else-if='info.state==2'>待生效</span>
          <span class="editbatch">
            <el-button size="mini" type="info" @click="backs">返回</el-button>
            <el-button size="mini" class="editbatch_edit" @click="batchedit" v-if="info.state==0||info.state==5">编辑批次信息</el-button>
          </span>
        </p>
        <div v-if='info.state==5' class="Dismissal">
          驳回原因：{{info.dismissalSeason}}
        </div>
        <el-dialog title="编辑批次信息" :visible.sync="isshows" width="650px" :close-on-click-modal="false">
          <el-form :model="copyinfo" :rules="ruless" ref="copyinfo" label-width="120px" class="demo-ruleForm">
            <el-form-item class="informationaa" label="批次名称:" prop="batchName">
              <el-input v-model="copyinfo.batchName" class="selects" size="mini" placeholder="请输入批次名称"></el-input>
            </el-form-item>

            <el-form-item class="informationaa" label="保险公司:" prop="insuranceId">
              <!--@change="changecomony(copyinfo.insuranceId)"-->
              <el-select class="selects" size="mini" disabled v-model="copyinfo.insuranceId" placeholder="请选择保险公司">
                <el-option-group v-for="group in options" :key="group.letter" :label="group.letter">
                  <el-option v-for="item in group.insurances" :key="item.id" :label="item.insuranceName" :value="item.id">
                  </el-option>
                </el-option-group>
              </el-select>
            </el-form-item>

            <el-form-item class="informationaa" label="适用工号:" prop="staffId">
              <el-select class="selects" size="mini" v-model="copyinfo.staffId" multiple placeholder="请选择">
                <el-option class="selects" v-for="item in workoptions" :key="item.id" :label="item.staffAccount" :value="item.id">
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item style="width:533px;margin:0 0 20px 0" class="informationaa" :class="{'begin-error':errormsg.beginerror,'end-error':errormsg.enderror}" label="有效时间:" required>
              <datachange :json="copyinfo" v-on:inf='inf'></datachange>

              <div class="el-form-item__error" v-if="errormsg.beginerror||errormsg.enderror">
                {{errormsg.message}}
              </div>
              <div class="z-errorbox">
                <p class="z-error texts">
                  <i class="iconfont icon-xuanzhong"></i> 以
                  <span>{{copyinfo.matchDateType}}</span>作为匹配日期类型
                </p>
              </div>

            </el-form-item>
            <!-- <div  style="margin:0;width:514px;">
							<datachange :json="copyinfo"></datachange>
						</div>

						<el-form-item class="informationaa informations" label=" ">
							<p class="texts">
								<i class="iconfont icon-xuanzhong"></i> 以<span>{{copyinfo.matchDateType}}</span>作为匹配日期类型
							</p>
						</el-form-item> -->
            <el-form-item class="informationaa informationdd">
              <el-button type="primary" :loading="loading1" size="small" class="btn" @click="btn('copyinfo')">确定</el-button>
            </el-form-item>
          </el-form>
        </el-dialog>
        <!--提交审核-->
        <el-dialog title="提示" :visible.sync="dialogTableVisible" width="700px" class="toDis-dialog upper4-dialog" :close-on-click-modal="false">
          <p class="dialog-tit">
            {{nowmessage}}
            <!-- 当前批次 “ <span class="toblue">{{info.batchName}}</span>”与以下政策批次有效时间重叠，点击“确定”，系统将自动修改重叠批次的截止时间为当前批次的开始时间 {{info.effectiveDate}} -->
          </p>
          <div class="dialog-max">
            <div class="visi-wrp">
              <div class="visi-list">
                <div class="list_name">
                  批次名称
                </div>
                <div class="list_time">
                  有效时间
                </div>
                <template v-for="item in existence">
                  <div class="list_name">
                    {{item.batchName}}
                  </div>
                  <div class="list_time">
                    {{item.effectiveDate}} -
                    <span v-if="item.expiryDate">{{item.expiryDate}}</span>
                    <span v-else>不限</span>
                  </div>
                </template>
              </div>
            </div>
          </div>
          <div slot="footer" class="dialog-footer">
            <el-button class="upper4-sureBtn" @click="goEdit" size="small" style="min-width:70px;">取消</el-button>
            <el-button class="upper4-sureBtn" type="primary" @click="toRoval_sure()" size="small" style="min-width:70px;">确定</el-button>
          </div>
        </el-dialog>
        <!--冲突不能提交-->
         <el-dialog title="提示" :visible.sync="candialogTableVisible" width="700px" class="toDis-dialog upper4-dialog" :close-on-click-modal="false">
          <p class="dialog-tit">
          	{{nowmessage}}
           </p>
          <div class="dialog-max">
            <div class="visi-wrp">
              <div class="visi-list">
                <div class="list_name">
                  批次名称
                </div>
                <div class="list_time">
                  有效时间
                </div>
                <template v-for="(item,index) in existence">
                  <div class="list_name">
                    {{item.batchName}}
                  </div>
                  <div class="list_time">
                    {{item.effectiveDate}} -
                    <span v-if="item.expiryDate">{{item.expiryDate}}</span>
                    <span v-else>不限</span>
                  </div>
                </template>
              </div>
            </div>
          </div>
          <div slot="footer" class="dialog-footer">
            <!-- <el-button class="upper4-sureBtn" @click="candialogTableVisible=false" size="small" style="min-width:70px;">取消</el-button> -->
            <el-button class="upper4-sureBtn" type="primary" @click="candialogTableVisible=false" size="small" style="min-width:70px;">关闭</el-button>
          </div>
        </el-dialog>
        
        
        
        
        
        <el-dialog title="审核提示" :visible.sync="ex_dialogTableVisible" width="500px" class="toDis-dialog upper4-dialog" :close-on-click-modal="false">
          <p class="dialog-tit">
            当前批次“
            <span class="toblue">{{info.batchName}}</span>”与以下政策批次有效时间重叠，审核通过后,系统会自动将当前批次（{{info.batchName}}）的开始时间修改为重叠批次的截止时间 {{info.effectiveDate}}
          </p>
          <div class="dialog-max">
            <div class="visi-wrp" v-for="(item,index) in existence">
              <!--<div class="visi-wrp">-->
              <div class="visi-list">
                <div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;批次名称：{{item.batchName}}</div>
                <div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;有效时间：{{item.effectiveDate}} -
                  <span v-if="item.expiryDate">{{item.expiryDate}}</span>
                  <span v-else>不限</span>
                </div>
              </div>
            </div>
          </div>
          <div slot="footer" class="dialog-footer">
            <el-button class="upper4-sureBtn" @click="ex_goEdit" size="small" style="min-width:70px;">取消</el-button>
            <el-button class="upper4-sureBtn" type="primary" @click="ex_toRoval_sure()" size="small" style="min-width:70px;">确定</el-button>
          </div>
        </el-dialog>
        <el-dialog title="驳回原因" :visible.sync="Rejectshow" width="690px" class="toDis-dialog2" :close-on-click-modal="false">
          <el-form :model="ruleForm" :rules="rulerepeat" ref="ruleForm" label-width="100px" class="demo-ruleForm">
            <el-row :gutter="20">
              <el-form-item label="" prop="dismissalSeason">
                <el-input class="toDis-textarea" type="textarea" rows="12" placeholder="请输入驳回原因" v-model="ruleForm.dismissalSeason"></el-input>
              </el-form-item>
            </el-row>
            <el-form-item class="dialog-sec-wp">
              <el-button size="small" type="primary" class="toDis-toRoval-btn" @click="toDis_sure('ruleForm')">确 定</el-button>
            </el-form-item>
          </el-form>
        </el-dialog>

        <div class="d-box">
          <!--<div class="editbatch" >
						<el-button size="mini" type="info" @click="backs">返回</el-button>
						<el-button  size="mini" class="editbatch_edit"  @click="batchedit" v-if="info.state==0||info.state==5">编辑批次信息</el-button>
					</div>-->

          <p>
            <span>保险公司：</span>
            <span class="d-setc">{{info.insuranceName}}</span>
            <span class="set30">有效日期：</span>
            <span class="d-setc">{{info.effectiveDate}}
              <span class="daos">到</span>
            </span>
            <span class="d-setc" v-if="info.expiryDate">{{info.expiryDate}}</span>
            <span class="d-setc" v-else> 不限</span>
            <span class="set30">匹配日期类型：</span>
            <span class="d-setc">{{info.matchDateType}}</span>&nbsp;&nbsp;
          </p>
          <div class="minflao">
            <span class="minflao_first">适用工号：</span>
            <span class="d-setc" v-for='(item,index) in info.staffNames'>
              <span class="isF">&nbsp;&nbsp;|&nbsp;&nbsp;</span>{{item.staffAccount}}
              <span v-if="info.staffNames.length-1!=index">，</span>
            </span>
            <div style="clear:both"></div>
          </div>


          <div class="minflao">
						<span class="minflao_first">总保单数：</span>
						<span class="d-setc">{{matchInfo.totalCount?matchInfo.totalCount:'-'}}</span>
						<span class="minflao_first set30">已匹配保单数：</span>
						<span class="d-setc">{{matchInfo.matchCount ?matchInfo.matchCount:'-'}}</span>
						<span class="minflao_first set30">未匹配保单数：</span>
						<span class="d-setc">{{matchInfo.notMatchCount ?matchInfo.notMatchCount:'-'}}</span>
						<span class="minflao_first set30">待匹配保单数：</span>
						<span class="d-setc">{{matchInfo.waitMatchCount?matchInfo.waitMatchCount:'-' }}</span>
						<span class="minflao_first set30"><a @click="getPi(1)" style="color:#027dca;text-decoration: underline;">刷新</a> <i  v-show="shua" class="el-icon-loading"></i></span>
						
						<div style="clear:both"></div>
					</div>
        </div>
      </div>
      <div class="p-list">
        <div class="tables">
          <div class="tables_top">
            <div class="tables_top1">
              <span>#</span>
              <span class="tablestop_dir">政策描述</span>
            </div>
            <div class="tables_topall">
              <div class="tables_top2">
                下游
              </div>
              <div class="tables_top3">
                <div class="tables_top3_top">
                  <span class="tables_top3_frame">交强险</span>
                  <span class="tables_top3_frame">商业险</span>
                  <span class="tables_top3_che">车船税</span>
                </div>
                <div class="tables_top3_bom">
                  <span class="tables_top3_frame">
                    <span>佣金</span>
                    <span>奖励</span>
                  </span>
                  <span class="tables_top3_frame">
                    <span>佣金</span>
                    <span>奖励</span>
                  </span>
                   <span class="tables_top3_che">
                    <span>佣金</span>
                   
                  </span>
                </div>
              </div>
              <div style="clear:both">

              </div>
            </div>
            <div class="tables_top4">
              操作
            </div>
          </div>

          <div class="tables_content" v-for='(item,indexout) in policylist'>
            <div class="tables_content1">
              <i class="iconfont" :class="!item.detailshow?'icon-tianjia':'icon-jianqu'" @click="isdetailshow(indexout,item)"></i>
              <div :class="indexout==indexActive?'tablescont_num2':'tablescont_num'">
								<span class="spanhover" v-show="!(indexout==indexActive)" @click="changeSelect(indexout,item)">{{item.serialNumber | changeNumber}}</span>
								 <!-- <i class="iconfont icon-bianji iIcon" ></i> -->
								<el-select v-model="item.serialNumber" :disabled="iscanedit" placeholder="请选择" size="mini" v-show="indexout==indexActive" class="selectIndex" @change="changeSelectIndex">
									<el-option
									v-for="item in snumbers"
									:key="item.id"
									:label="item.label"
									:value="item.value">
									</el-option>
								</el-select>
							</div>
              <div class="tablescont_dis">{{item.remarks}}</div>
            </div>

            <div class="tables_contentall">
              <div class="tables_contentall_in">
                <div class="tables_content2">
                  通用
                   <el-popover placement="top" width="280" :ref="'popadd'+indexout">
                          <el-form :model="batchChild" :rules="rules" :ref="'batchChilds'+indexout" label-width="150px">

                            <el-form-item label="子机构" label-width="70px" prop="targetId">
                              <el-select v-if="!isSingle" no-data-text="无部门可选" class="wd150" v-model="batchChild.targetId" size="mini" placeholder="请选择子机构">
                                <el-option v-for="item in organization" :label="item.organizationName" :key="item.organizationId" :value="item.organizationId"></el-option>
                              </el-select>
                              <el-select v-if="isSingle" no-data-text="无部门可选" class="wd150" v-model="batchChild.targetId" size="mini" placeholder="请选择子机构">
                                <el-option v-for="item in childorganization" :label="item.organizationName" :key="item.organizationId" :value="item.organizationId"></el-option>
                              </el-select>
                            </el-form-item>

                          </el-form>
                          <div style="text-align: right; margin: 0">
                            <el-button size="mini" type="text" @click="cancelpoparr('popadd'+indexout)">取消</el-button>
                            <el-button type="primary" size="mini" @click.stop="saveBatchchilds('batchChilds'+indexout,'popadd'+indexout)" :loading="childloding">确定</el-button>
                          </div>
                          <i v-if="info.state==0||info.state==5" slot="reference" title="添加子机构" class="iconfont icon-plus" @click="singleAdd(item.policyId,indexout)"></i>
                        </el-popover>
                  <!--<i title="添加子机构"  v-if="info.state==0||info.state==5" class="iconfont icon-plus" @click="singleAdd(item.policyId)"></i>-->
               
                
                </div>
                <div class="tables_content3" slot="reference" :class="item.isbackshow?'backshows':''">
                  <span class="tables_top3_frame tables_content3_inp">
                    <span class="tables_content3_inpin" :class="item.change1?'ischange1':''">
                      <span v-if="item.lowerChargeType==1">-</span>
                      <input type="text" @focus="focusselect($event)" :class="{'isfrontshow':item.isfront,'isdis':iscanedit}" :disabled="iscanedit" class="inputset" v-model="item.lowerBrokerageTraffic" @input='getchange_num($event,indexout,"lowerBrokerageTraffic",item.lowerBrokerageBusinessType)' />
                      <span v-if="item.lowerBrokerageBusinessType==0" class="Percentage_color">%</span>
                      <span v-else class="Percentage_color">元</span>
                    </span>
                    <span class="tables_content3_inpin" :class="item.change2?'ischange2':''">
                      <span v-if="item.lowerChargeType==1">-</span>
                      <input type="text" @focus="focusselect($event)" :class="{'isfrontshow':item.isfront,'isdis':iscanedit}" :disabled="iscanedit" class="inputset" @input='getchange_num($event,indexout,"lowerRewardTraffic",item.lowerBrokerageBusinessType)' v-model="item.lowerRewardTraffic" />
                      <span v-if="item.lowerBrokerageBusinessType ==0" class="Percentage_color">%</span>
                      <span v-else class="Percentage_color">元</span>
                    </span>
                  </span>
                  <span class="tables_content3_inp tables_top3_frame">
                    <span class="tables_content3_inpin" :class="item.change3?'ischange3':''">
                      <span v-if="item.lowerChargeType==1">-</span>
                      <input type="text" @focus="focusselect($event)" :class="{'isseconshow':item.issecon,'isdis':iscanedit}" :disabled="iscanedit" class="inputset" v-model="item.lowerBrokerageBusiness" @input='getchange_num($event,indexout,"lowerBrokerageBusiness",item.lowerBrokerageBusinessType)' />
                      <span v-if="item.lowerBrokerageBusinessType ==0" class="Percentage_color">%</span>
                      <span v-else class="Percentage_color">元</span>
                    </span>
                    <span class="tables_content3_inpin" :class="item.change4?'ischange4':''">
                      <span v-if="item.lowerChargeType==1">-</span>
                      <input type="text" @focus="focusselect($event)" :class="{'isseconshow':item.issecon,'isdis':iscanedit}" :disabled="iscanedit" class="inputset" v-model="item.lowerRewardBusiness" @input='getchange_num($event,indexout,"lowerRewardBusiness",item.lowerBrokerageBusinessType)' />
                      <span v-if="item.lowerBrokerageBusinessType ==0" class="Percentage_color">%</span>
                      <span v-else class="Percentage_color">元</span>
                    </span>
                  </span>
                  <span class="tables_content3_inp tables_content3_che">
                  	<span class="tables_content3_inpin" :class="item.change5?'ischange5':''">
                      <span v-if="item.lowerChargeType==1">-</span>
                      <input type="text" @focus="focusselect($event)" :disabled="iscanedit" class="inputset" 
                      	:class="{'isdis':iscanedit}"
                      	v-model="item.lowerBrokerageVehicleTax" 
                      	@input='getchange_num($event,indexout,"lowerBrokerageVehicleTax",item.lowerBrokerageBusinessType)' />
                      <span v-if="item.lowerBrokerageBusinessType ==0" class="Percentage_color">%</span>
                      <span v-else class="Percentage_color">元</span>
                    </span>
                  </span>
                  <div class="poper_operation">
                    <span type="text" @click="subfalse(indexout)">取消</span>
                    <span type="text" @click="subpolicy(item,indexout)">保存</span>
                  </div>
                </div>

                <div style="clear:both">

                </div>
              </div>

              <div v-for="(val,index) in item.extends" class="tables_contentall_in">
                <div class="tables_content2">
                  <!-- <el-tooltip placement="bottom" effect="light" v-if="val.describe.length!=0">
                    <div slot="content">
                      <p class="describe_text" v-for="onelist in val.describe">{{onelist}}</p>
                    </div>
                    <span ref="tabindex2">{{val.describe[0]}}</span> -->
                    <!-- <span ref="tabindex2">子机构（{{val.describe.length}}）</span> -->

                  <!-- </el-tooltip> -->
                  <!-- <el-tooltip placement="bottom" effect="light" v-else>
                    <div slot="content">
                      <p class="describe_text">暂无数据</p>
                    </div>
                  </el-tooltip> -->
                  <span :title="val.describe[0]">{{val.describe[0]}}</span>
                  <i class="iconfont icon-shanchu" title="删除子机构"  v-if="info.state==0||info.state==5" @click="deletChild(item.policyId,val.policyItemRateId)"></i>
                </div>
                <!--<el-popover
							trigger="hover"
						  placement="right-end"
						  width="40"
						  v-model="val.hovershow">
						  
						  <div class="poper_operation">
						    <span type="text"  @click="subfalseextend(indexout,index)">取消</span>
						    <span type="text"  @click="subpolicyextends(val,indexout,index)">保存</span>
						  </div>
						  
						  <div class="tables_content3" slot="reference" :class="val.isbackshow?'backshows':''">
								<span class="tables_top3_frame tables_content3_inp">
										<span class="tables_content3_inpin"  :class="val.change1?'ischange1':''">
											<span v-if="val.chargeType==1">-</span>
											
											<input type="text" @focus="focusselect($event)" :class="{'isfrontshow':val.isfront,'isdis':iscanedit}" :disabled="iscanedit" v-model="val.lowerBrokerageTraffic" class="inputset" @change='getchange_extendnum($event,indexout,index,"lowerBrokerageTraffic",val.brokerageBusinessType)'/>
											<span v-if="val.brokerageBusinessType==0"  class="Percentage_color">%</span>
											<span v-else  class="Percentage_color">元</span>
										</span>
										<span class="tables_content3_inpin" :class="val.change2?'ischange2':''">
											<span v-if="val.chargeType==1">-</span>
											<input type="text" @focus="focusselect($event)" :class="{'isfrontshow':val.isfront,'isdis':iscanedit}" :disabled="iscanedit" v-model="val.lowerRewardTraffic" class="inputset" @change='getchange_extendnum($event,indexout,index,"lowerRewardTraffic",val.brokerageBusinessType)'/>
											<span v-if="val.brokerageBusinessType==0"  class="Percentage_color">%</span>
											<span v-else  class="Percentage_color">元</span>
										</span>
								</span>
								<span class="tables_content3_inp">
										<span class="tables_content3_inpin" :class="val.change3?'ischange3':''">
											<span v-if="val.chargeType==1">-</span>
											
											<input @focus="focusselect($event)" type="text" :class="{'isseconshow':val.issecon,'isdis':iscanedit}" :disabled="iscanedit" v-model="val.lowerBrokerageBusiness" class="inputset"
											@change='getchange_extendnum($event,indexout,index,"lowerBrokerageBusiness",val.brokerageBusinessType)'	
											/>
											<span v-if="val.brokerageBusinessType==0"  class="Percentage_color">%</span>
											<span v-else  class="Percentage_color">元</span>
										</span>
										<span class="tables_content3_inpin" :class="val.change4?'ischange4':''">
											<span v-if="val.chargeType==1">-</span>
											<input @focus="focusselect($event)" type="text" :class="{'isseconshow':val.issecon,'isdis':iscanedit}" :disabled="iscanedit" v-model="val.lowerRewardBusiness" class="inputset"
											@change='getchange_extendnum($event,indexout,index,"lowerRewardBusiness",val.brokerageBusinessType)'	
											/>
											<span v-if="val.brokerageBusinessType==0"  class="Percentage_color">%</span>
											<span v-else  class="Percentage_color">元</span>
										</span>
								</span>
							</div>
						
						</el-popover>-->

                <div class="tables_content3" slot="reference" :class="val.isbackshow?'backshows':''">
                  <span class="tables_top3_frame tables_content3_inp">
                    <span class="tables_content3_inpin" :class="val.change1?'ischange1':''">
                      <span v-if="val.chargeType==1">-</span>

                      <input type="text" @focus="focusselect($event)" :class="{'isfrontshow':val.isfront,'isdis':iscanedit}" :disabled="iscanedit" v-model="val.lowerBrokerageTraffic" class="inputset" @input='getchange_extendnum($event,indexout,index,"lowerBrokerageTraffic",val.brokerageBusinessType)' />
                      <span v-if="val.brokerageBusinessType==0" class="Percentage_color">%</span>
                      <span v-else class="Percentage_color">元</span>
                    </span>
                    <span class="tables_content3_inpin" :class="val.change2?'ischange2':''">
                      <span v-if="val.chargeType==1">-</span>
                      <input type="text" @focus="focusselect($event)" :class="{'isfrontshow':val.isfront,'isdis':iscanedit}" :disabled="iscanedit" v-model="val.lowerRewardTraffic" class="inputset" @input='getchange_extendnum($event,indexout,index,"lowerRewardTraffic",val.brokerageBusinessType)' />
                      <span v-if="val.brokerageBusinessType==0" class="Percentage_color">%</span>
                      <span v-else class="Percentage_color">元</span>
                    </span>
                  </span>
                  <span class="tables_content3_inp tables_top3_frame">
                    <span class="tables_content3_inpin" :class="val.change3?'ischange3':''">
                      <span v-if="val.chargeType==1">-</span>

                      <input @focus="focusselect($event)" type="text" :class="{'isseconshow':val.issecon,'isdis':iscanedit}" :disabled="iscanedit" v-model="val.lowerBrokerageBusiness" class="inputset" @input='getchange_extendnum($event,indexout,index,"lowerBrokerageBusiness",val.brokerageBusinessType)' />
                      <span v-if="val.brokerageBusinessType==0" class="Percentage_color">%</span>
                      <span v-else class="Percentage_color">元</span>
                    </span>
                    <span class="tables_content3_inpin" :class="val.change4?'ischange4':''">
                      <span v-if="val.chargeType==1">-</span>
                      <input @focus="focusselect($event)" type="text" :class="{'isseconshow':val.issecon,'isdis':iscanedit}" :disabled="iscanedit" v-model="val.lowerRewardBusiness" class="inputset" @input='getchange_extendnum($event,indexout,index,"lowerRewardBusiness",val.brokerageBusinessType)' />
                      <span v-if="val.brokerageBusinessType==0" class="Percentage_color">%</span>
                      <span v-else class="Percentage_color">元</span>
                    </span>
                  </span>
                 	<span class="tables_content3_inp tables_content3_che">
                 		<span class="tables_content3_inpin" :class="val.change5?'ischange5':''">
                 			<span v-if="val.chargeType==1">-</span>
                      <input @focus="focusselect($event)" type="text"  :disabled="iscanedit" v-model="val.lowerBrokerageVehicleTax" class="inputset" @input='getchange_extendnum($event,indexout,index,"lowerBrokerageVehicleTax",val.brokerageBusinessType)' />
                      <span v-if="val.brokerageBusinessType==0" class="Percentage_color">%</span>
                     <span v-else class="Percentage_color">元</span>
                 			
                 		</span>
                 			
                 	</span>
                 
                 <div class="poper_operation">
                    <span type="text" @click="subfalseextend(indexout,index)">取消</span>
                    <span type="text" @click="subpolicyextends(val,indexout,index)">保存</span>
                  </div>
                </div>

                <div style="clear:both">

                </div>
              </div>

            </div>

            <div class="tables_content4">
              <template v-if="info.state==0||info.state==5">
                <!-- <a  @click="addlowpolic(item)">添加&nbsp;&nbsp;&nbsp;</a> -->
                <a @click="toDetail(item.policyId,'01')">编辑</a>
                <a @click="tocopy(item.policyId)" class="tablescont_right_edit">复制</a>
                <el-popover placement="bottom-end" width="250" :ref='"aa"+indexout' v-model="item.delete_show">
                  <p class="candeletes">确定删除吗？</p>
                  <div style="text-align: right; margin: 0">
                    <el-button size="mini" type="text" @click="deletefalse('aa'+indexout)">取消</el-button>
                    <el-button type="primary" size="mini" @click="deletepolicy(item.policyId,indexout,'aa'+indexout)">确定</el-button>
                  </div>
                  <a class="tablescont_right_delete" slot="reference" ref="tanindexs">删除</a>
                </el-popover>
              </template>
              <template v-else>
                <a @click="toDetail(item.policyId,'02')">详情</a>
              </template>

            </div>
            <div style="clear:both">

            </div>
            <div class="shoedetails" v-loading="item.loadings" v-if="item.detailshow">
              <template v-if="item.showdetails">
                	<div class="detail_left">
                        <div style="display:flex;width: 90%;margin-top:24px;">
                          <p class="detailname" v-show="item.isFalse">车辆种类:</p>
                          <div class="detailCon" >
                               <div class="detailconytent" v-for="val in item.showdetails"  v-if="val.filterType==1">
                                  <p class="spanname"><i class='iconfont icon-lingxing'> </i>{{val.filterName}}:</p>
                                  <p class="spantext">{{val.filterValue}}</p>
                                  <div style="clear:both">

                                  </div>
                                </div>
                          </div>
                         
                         </div>
                      </div>
               
							

                        <div class="detail_right">
                          <div style="display:flex;width: 90%;margin-top:18px;margin-bottom: 24px;">
                            <p class="detailname"  v-show="item.isFalse2">保单信息:</p>
                            <div class="detailCon" >
                              <div class="detailconytent" v-for="val in item.showdetails" v-if="val.filterType==2">
                                <p class="spanname"  v-if="val.filterName != '投放区域'"><i class='iconfont icon-lingxing'></i>{{val.filterName}}:</p>
                                <p class="spanname" style="width:93px;" v-else-if="val.filterName == '不包含险种'"><i class='iconfont icon-lingxing'> </i>不包含险种:</p>
                                <p class="spanname" style="width:108px;" v-else-if="val.filterName == '出险次数规则'"><i class='iconfont icon-lingxing'> </i>出险次数规则:</p>
                                <p class="spanname"  v-else><i class='iconfont icon-lingxing'></i>投放区域:</p>
                                <p class="spantext"  v-if="val.filterName != '投放区域'">{{val.filterValue}}</p>
                                <p class="spantext"  v-else >
                                   <span style="    display: block;" v-for="quyu in val.regions">

                                     <el-popover
                                  placement="top-start"
                                  :title="quyu.typeName"
      
                                  trigger="hover">

                                  <div style="diqu">{{quyu.regionName}}</div>
                                  <span slot="reference">{{quyu.typeName}}</span>
                                </el-popover>
                                  </span>
                                </p>
                                <div style="clear:both">

                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                <div style="clear:both;">

                </div>
              </template>
              <template v-else>
                <div class="nodata">
                  暂无数据
                </div>
              </template>
            </div>
          </div>
          <div class="tables_bom" v-if="info.state==0||info.state==5">
            <div class="tables_bom_left">
              <span @click='toEdit()'>
                <i class="iconfont icon-plus"></i>
                <span>新建政策</span>
              </span>

              <!--<span class="addson">
							<i class="iconfont icon-plus"></i>
							<span>新建子机构政策</span>
						</span>-->
            </div>
            <div class="tables_bom_son">
            	 <el-popover v-if='!this.isNull' placement="top" width="280" ref="popadds">
                          <el-form :model="batchChild" :rules="rules" ref="batchChild" label-width="150px">

                            <el-form-item label="子机构" label-width="70px" prop="targetId">
                              <el-select v-if="!isSingle" no-data-text="无部门可选" class="wd150" v-model="batchChild.targetId" size="mini" placeholder="请选择子机构">
                                <el-option v-for="item in organization" :label="item.organizationName" :key="item.organizationId" :value="item.organizationId"></el-option>
                              </el-select>
                              <el-select v-if="isSingle" no-data-text="无部门可选" class="wd150" v-model="batchChild.targetId" size="mini" placeholder="请选择子机构">
                                <el-option v-for="item in childorganization" :label="item.organizationName" :key="item.organizationId" :value="item.organizationId"></el-option>
                              </el-select>
                            </el-form-item>

                          </el-form>
                          <div style="text-align: right; margin: 0">
                            <el-button size="mini" type="text" @click="cancelpop('popadds')">取消</el-button>
                            <el-button type="primary" size="mini" @click.stop="saveBatchchild('batchChild','popadds')" :loading="childloding">确定</el-button>
                          </div>
                          <span  slot="reference" title="批量添加子机构" class="iconfont icon-plus" @click="batchNew">批量添加子机构</span>
                        </el-popover>
              <!--<span v-if='!this.isNull' @click="batchNew">批量添加子机构</span>-->
              					<span v-else class="isNull">批量添加子机构</span>
            </div>
            <div class="tables_bom_cen">
              <span :class="this.moresave?'':'havemaoe'" @click="moresaves">批量保存</span>
            </div>
            <div class="tables_bom_right">

            </div>
          </div>
        </div>

      </div>
      <div class="p-btn">
        <el-button size='mini' v-if="info.state==0||info.state==5" class='wd100 setborder' @click="toexamine" :loading="loading4">{{rovalHtml}}</el-button>
        <el-button size='mini' v-if="info.state==0||info.state==5" class='wd100 setborder' @click="deletebatch">删除</el-button>
        <el-button size='mini' v-if="(info.state!==0 && info.state!==5)&&Jurisdiction==1" class='wd100 setborder' @click="Applicationeditor" :loading="loading5">申请编辑</el-button>
        <!--<el-button size='mini' v-if="info.state==2||info.state==3||info.state==4" class='wd100 setborder' @click="generate">生成下游政策</el-button>-->
        <!--<el-button size='mini' :loading="loading" v-if="info.state==1&&Jurisdiction==2" class='wd100 setborder' @click="adopt">通过</el-button>
				<el-button size='mini' v-if="info.state==1&&Jurisdiction==2" class='wd100 setborder' @click="reject" :loading="loading6">驳回</el-button>
			-->
        <div class="adoptorreject" v-if="info.state==1&&this.Jurisdiction==2">
          <p class="adoptdis">审核结果及说明</p>
          <div class="adoptresult">
            <p>审核结果：</p>
            <div id="">
              <el-radio v-model="radios" label="1">通过</el-radio>
              <el-radio v-model="radios" label="2">驳回</el-radio>
            </div>
          </div>
          <div class="adoptresult">
            <p>说&emsp;&emsp;明：</p>
            <div class="adoptresultbom">
              <el-input class="reason_wid" type="textarea" :autosize="{ minRows: 2, maxRows: 4}" placeholder="请输入内容" v-model="dismissalSeason">
              </el-input>
            </div>
          </div>
          <div style="clear:both">

          </div>
          <el-button size='mini' class='setborder adoptsub' @click="isaddport" :loading="loading6">提交</el-button>
        </div>

      </div>
      <el-dialog title="添加下游政策" :visible.sync="isshow" width="550px" :close-on-click-modal='false'>
        <div class="content">
          <el-form :model="json" :rules="rules" ref="json" label-width="150px">
            <el-form-item label="添加对象类型:" label-width="150px" prop="extendType">
              <!--<el-select class="inputs" v-model="json.extendType" size="mini" placeholder="请选择部门" @change="changeobjs">
								<el-option v-for="item in objtypelist" :label="item.name" :value="item.value"></el-option>
							</el-select>-->
              部门
            </el-form-item>
            <el-form-item label="添加对象" label-width="150px" prop="targetId">
              <el-select v-if="json.extendType==1" no-data-text="无部门可选" class="inputs" multiple v-model="json.targetId" size="mini" placeholder="请选择对象">
                <el-option v-for="item in organization" :label="item.organizationName" :key="item.organizationId" :value="item.organizationId"></el-option>
              </el-select>

              <el-select v-else class="inputs" no-data-text="无用户可选" multiple v-model="json.targetId" size="mini" placeholder="请选择对象">
                <el-option v-for="item in userlist" :label="item.name" :value="item.id" :key="item.id"></el-option>
              </el-select>
            </el-form-item>

            <el-form-item label="交强险设置:" label-width="150px">
              <div class="numcontent" :class="indexs==1?'actives':''">
                <span>
                  佣金
                  <input @focus="focusselect($event)" @change="clearNoNum_2($event,'lowerBrokerageTraffic',100)" class="numinp" v-model="json.lowerBrokerageTraffic" />
                  <span class="Percentage_color"> {{json.brokerageBusinessType | isPercentage}}</span>
                </span>

                <span>
                  奖励
                  <input @focus="focusselect($event)" @change="clearNoNum_2($event,'lowerRewardTraffic',100)" class="numinp" v-model="json.lowerRewardTraffic" size="mini" />
                  <span class="Percentage_color"> {{json.brokerageBusinessType | isPercentage}}</span>
                </span>

              </div>
            </el-form-item>

            <el-form-item label="商业险设置:" label-width="150px">
              <div class="numcontent" :class="indexs_tow==2?'actives_tuo':''">
                <span>
                  佣金
                  <input @focus="focusselect($event)" @change="clearNoNum_2($event,'lowerBrokerageBusiness',100)" class="numinp" v-model="json.lowerBrokerageBusiness" size="mini" />
                  <span class="Percentage_color"> {{json.brokerageBusinessType | isPercentage}}</span>
                </span>

                <span>
                  奖励
                  <input @focus="focusselect($event)" @change="clearNoNum_2($event,'lowerRewardBusiness',100)" class="numinp" v-model="json.lowerRewardBusiness" size="mini" />
                  <span class="Percentage_color"> {{json.brokerageBusinessType | isPercentage}}</span>
                </span>

              </div>
            </el-form-item>
            <el-form-item class="btns">

              <el-button type="primary" @click.stop="submits('json')" :loading="loading2">确 定</el-button>
            </el-form-item>

          </el-form>
        </div>
      </el-dialog>
      
      <!--<el-dialog :title="dialogTitle" :visible.sync="batchDialog" width="550px" :close-on-click-modal='false'>
        <div class="content">
          <el-form :model="batchChild" :rules="rules" ref="batchChild" label-width="150px">

            <el-form-item label="子机构" label-width="150px" prop="targetId">
              <el-select  v-if="!isSingle" no-data-text="无部门可选" class="inputs" v-model="batchChild.targetId" size="mini" placeholder="请选择子机构">
                <el-option v-for="item in organization" :label="item.organizationName" :key="item.organizationId" :value="item.organizationId"></el-option>
              </el-select>
              <el-select  v-if="isSingle" no-data-text="无部门可选" class="inputs" v-model="batchChild.targetId" size="mini" placeholder="请选择子机构">
                <el-option v-for="item in childorganization" :label="item.organizationName" :key="item.organizationId" :value="item.organizationId"></el-option>
              </el-select>
            </el-form-item>

            <el-form-item class="btns">

              <el-button type="primary" size="small" @click.stop="saveBatchchild('batchChild')" :loading="childloding">确 定</el-button>
            </el-form-item>

          </el-form>
        </div>
      </el-dialog>-->

    </div>
  </div>
</template>
<script>
import Vue from "vue";
import nextnav from "./assembly/nextnav";
import treeSelect from "@/components/tree-select/tree.vue";
import api from "@/api/api.js";
import datachange from "@/components/datachange/datachange";
export default {
  data() {
    return {
      isNull:false,//批量添加可用
      radios: "1",
      moresave: false,
      dismissalSeason: "",
      ruleForm: {
        dismissalSeason: null
      },
      ruless: {
        batchName: [
          {
            required: true,
            message: "请输入批次名称",
            trigger: "blur"
          }
        ]
      },
      rulerepeat: {
        dismissalSeason: [
          {
            required: true,
            message: "请输入驳回原因",
            trigger: "blur"
          }
        ]
      },
      Rejectshow: false,
      dialogTableVisible: false,
      ex_dialogTableVisible: false,
      existence: [],
      rovalHtml: "提交审核",
      isshows: false,
      id: null, //当前id
      policylist: [],
      copypolicylist: [],
      options: [],
      uppoliy: [],
      workoptions: [],
      info: {},
      navnum: 2,
      dialogShow: false,
      //dialog
      isshow: false,
      formLabelWidth: "120px",
      objtypelist: [
        //对象列表
        //					{name:"政策",value:"0"},
        {
          name: "组织",
          value: "1"
        },
        {
          name: "用户",
          value: "2"
        }
      ],
      premiumlist: [
        //保费列表
        {
          name: "按净保费",
          value: 1
        },
        {
          name: "按全保费",
          value: 0
        }
      ],
      Maidlist: [
        //保费列表
        {
          name: "百分比",
          value: 0
        },
        {
          name: "人名币",
          value: 1
        }
      ],
      Pointslist: [
        //扣点
        {
          name: "是",
          value: 1
        },
        {
          name: "否",
          value: 0
        }
      ],
      addobj: [
        //添加对象列表
      ],
      rule: {
        batchName: [
          {
            required: true,
            message: "请输入批次名称",
            trigger: "blur"
          },
          {
            min: 1,
            max: 50,
            message: "长度在 1 到 50个字符",
            trigger: "blur"
          }
        ]
      },
      rules: {
        extendType: [
          {
            required: true,
            message: "请选择对象类型",
            trigger: "change"
          }
        ],
        targetId: [
          {
            required: true,
            message: "请选择对象",
            trigger: "change"
          }
        ],
        premiumType: [
          {
            required: true,
            message: "请选择保费类型",
            trigger: "change"
          }
        ],
        brokerageBusinessType: [
          {
            required: true,
            message: "请选择返佣类型",
            trigger: "change"
          }
        ],
        chargeType: [
          {
            required: true,
            message: "请选择是否扣点",
            trigger: "change"
          }
        ]
      },
      json: {
        policyItemId: "", //政策id
        extendType: "1", //对象类型,
        targetId: [], //对象
        lowerBrokerageTraffic: "0", //交强-佣金
        lowerRewardTraffic: "0", //较强——奖励
        lowerBrokerageBusiness: "0", //商业-佣金
        lowerRewardBusiness: "0", //商业——奖励
        lowerBrokerageVehicleTax: "0" //下游车船税佣金比例
        //	remarks: "" //备注
      },
      userlist: [],
      treeData: [], //树数据
      treeProps: {
        label: "displayName",
        children: "orgs",
        level: "depth",
        value: "id"
      }, //树属性
      copyinfo: {
        staffId: []
      },
      islimit: false,
      policyId: null,
      Jurisdiction: "",
      indexs: null,
      indexs_tow: null,
      additional: {},
      organization: [],
      loading1: false,
      loading2: false,
      loading3: false,
      loading4: false,
      loading5: false,
      loading6: false,
      showdetails: [],
      iscanedit: false,
      errormsg: {
        beginerror: false,
        enderror: false,
        message: ""
      },
      unli: true,
      batchDialog: false,
      isSingle :false,
      organization: [],
      batchChild: {},
      dialogTitle:'',
      childpolicyId:'',
      childorganization:[],
      childloding:false,
      isFalse:true,
      isFalse2:true,
      candialogTableVisible: false,
				nowmessage: "",
				newid: "",
				isbacktrue:null,
 snumbers:[],
        indexActive:null,matchInfo:[],
				shua:false    };
  },
  watch: {
     "$route":function(to,from){
       console.log(to)
       console.log(from)
        //from 对象中包含当前地址
        //to 对象中包含目标地址
        //其实还有一个next参数的，这个参数是控制路由是否跳转的，如果没写，可以不用写next()来代表允许路由跳转，如果写了就必须写next(),否则路由是不会生效的。
    },
    islimit() {
      if (this.islimit == true) {
        this.copyinfo.expiryDate = "";
      }
    }
  },
  mounted() {
    var that = this;
    setTimeout(function() {
      console.log(11111111111111111);
      console.log(that.$refs);
      //tabindex2
      if (that.$refs.tanindexs) {
        that.$refs.tanindexs.map((val, index) => {
          that.$refs.tanindexs[index].setAttribute("tabindex", "-1");
        });
      }
      if (that.$refs.tabindex2) {
        that.$refs.tabindex2.map((val, index) => {
          that.$refs.tabindex2[index].setAttribute("tabindex", "-1");
        });
      }
    }, 1000);
    if(this.$route.query.isback){
				this.isbacktrue=this.$route.query.isback
			}
    //batchId Jurisdiction
    this.id = this.$route.query.batchId;
    this.Jurisdiction = this.$route.query.Jurisdiction;
    this.getBasic();
    this.getPolicyList();
    this.getPi()
  },
  filters: {
    isPercentage(val) {
      if (val == 0) {
        return "%";
      } else {
        return "元";
      }
    },
    changeNumber(val) {
      if (val < 10) {
        return "0" + val;
      } else {
        return val;
      }
    }
  },
  components: {
    nextnav,
    treeSelect,
    datachange
  },
  methods: {
    	getPi(type){
				this.shua = true
				let params ={
					id :this.id
				}
				this.post(params, "	services/app/policy/PolicyMatchInfo").then(re => {
						if(re.success) {
							this.shua = false
							console.log(re)
              this.matchInfo = re .result
              // if(type){
              //    this.$message({
							// 		message: '刷新成功',
							// 		type: 'success'
							// 		});
              // }
						}else{
							this.shua = false
						}
					});
			
			},
  	cancelpoparr(val){
  		this.$refs[val][0].doClose();
  	},
	 cancelpop(val){
	 	console.log(val)
	 	
	 		this.$refs[val].doClose();
	 
       
    },
    showdetailsLen(){
      console.log(this.showdetails.length)

      for(let i = 0; i < this.showdetails.length; i++){
        //  console.log( this.isFalse)
        // console.log(this.showdetails[i].filterType != 1)
        if(this.showdetails[i].filterType == 1){
          this.isFalse = true
          return;
        }else{
          this.isFalse = false
        }
        //  if(this.showdetails[i].filterType == 2){
        //   this.isFalse2 = true
        //   return;
        // }else{
        //   this.isFalse2 = false
        // }
      }
    },

    inf(val) {
      this.unli = val;
    },
    focusselect(val) {
      console.log(1111);
      console.log(val);
      val.currentTarget.select();
    },

    //获取展开信息
    getshowdetail(e,val) {
      let params = {
        batchId: this.id,
        policyItemId: val.policyId
      };
      this.post(params, "services/app/policy/GetPolicyFiltersToExpand").then(
        res => {
          if (res.success) {
            console.log("detail");
            console.log(res);
            this.policylist.map((item, index) => {
							
							if(index == e) {
								Vue.set(item, "loadings", false);
								Vue.set(item, "isFalse", false);
							Vue.set(item, "isFalse2", false);
								Vue.set(item, "showdetails", res.result.items);
								item.showdetails.map((val)=>{
									if(val.filterType == 1) {
										Vue.set(item, "isFalse", true);
									} 
									if(val.filterType == 2) {
										Vue.set(item, "isFalse2", true);
									} 
								})	
							} 				
						});
          } else {
            	let arr = [];
							this.policylist.map((item, index) => {
							if(index == e) {
								Vue.set(item, "showdetails", arr);
							} 				
						});
            this.$message({
              type: "warning",
              message: "信息填写错误"
            });
          }
        }
      );
    },
    //通过活驳回
    isaddport() {
      if (this.radios == 1) {
        this.adopt();
      } else {
        this.toDis_sure();
      }
    },
    //返回
    backs() {
      this.$router.go(-1);
    },
    //缸盖对象还是用户
    changeobjs() {
      let arr = [];
      Vue.set(this.json, "targetId", arr);
    },
    //获取组织
    gethomes(val) {
      //organization
      let params = {
        id: val
      };
      this.post(params, "services/app/policy/ChildOrganizations").then(res => {
        console.log(res);
        if (res.success) {
          console.log("zuzhi");
          console.log(res);
          this.organization = res.result.all;
        } else {
          this.$notify.error({
            title: "错误",
            message: res.error.message
          });
        }
      });
    },
    //弹出删除
    isdeletetrue(val, e, oute) {
      this.edithide();
      console.log(1111);
      var arr = [];
      for (let i = 0; i < this.policylist.length; i++) {
        if (i == oute) {
          for (let j = 0; j < this.policylist[i].extends.length; j++) {
            arr.push(this.policylist[i].extends[j]);
            if (j == e) {
              arr[j].isdelete = true;
            } else {
              arr[j].isdelete = false;
            }
          }
          this.policylist[i].extends = arr;
        }
      }
    },
    //编辑展示
    editshow(val, e, oute) {
      this.indexs = null;
      this.indexs_tow = null;
      console.log(val);
      //	this.isdeletefalse()
      //iseditshow
      let str = JSON.stringify(val);
      this.additional = JSON.parse(str);
      var arr = [];
      for (let i = 0; i < this.policylist.length; i++) {
        if (i == oute) {
          for (let j = 0; j < this.policylist[i].extends.length; j++) {
            arr.push(this.policylist[i].extends[j]);
            if (j == e) {
              arr[j].iseditshow = true;
            } else {
              arr[j].iseditshow = false;
            }
          }
          this.policylist[i].extends = arr;
        }
      }
    },
    //取消删除
    isdeletefalse() {
      for (let i = 0; i < this.policylist.length; i++) {
        let arr = [];
        for (let j = 0; j < this.policylist[i].extends.length; j++) {
          arr.push(this.policylist[i].extends[j]);
          arr[j].isdelete = false;
        }
        this.policylist[i].extends = arr;
      }
    },
    //取消编辑
    edithide() {
      for (let i = 0; i < this.policylist.length; i++) {
        let arr = [];
        for (let j = 0; j < this.policylist[i].extends.length; j++) {
          arr.push(this.policylist[i].extends[j]);
          arr[j].iseditshow = false;
        }
        this.policylist[i].extends = arr;
      }
    },
    //下通编辑展示
    Lowerpasseeditshow(val, e) {
      this.indexs = null;
      this.indexs_tow = null;
      console.log(val);
      let str = JSON.stringify(val);
      this.additional = JSON.parse(str);
      var arr = [];
      for (let i = 0; i < this.policylist.length; i++) {
        arr.push(this.policylist[i]);
        if (i == e) {
          arr[i].Lowerpassiseditshow = true;
        } else {
          arr[i].Lowerpassiseditshow = false;
        }
      }

      this.policylist = arr;
    },
    Lowerpassedithide() {
      var arr = [];
      for (let i = 0; i < this.policylist.length; i++) {
        arr.push(this.policylist[i]);
        arr[i].Lowerpassiseditshow = false;
      }

      this.policylist = arr;
    },
    clearNoNum(obj, name, maxnum) {
      if (name) {
        this.additional[name] = api.clearNoNum_target(
          obj,
          maxnum,
          this.additional.brokerageBusinessType
        );
      }
    },
    //clearNoNum_2
    clearNoNum_2(obj, name, maxnum) {
      if (name) {
        this.json[name] = api.clearNoNum_target(
          obj,
          maxnum,
          this.json.brokerageBusinessType
        );
      }
    },
    clearNoNum_down(obj, name, maxnum) {
      if (name) {
        this.additional[name] = api.clearNoNum_target(
          obj,
          maxnum,
          this.additional.brokerageBusinessType
        );
      }
    },
    deletefalse(val) {
      //		    	var arr=[]
      //				for(let i=0;i<this.policylist.length;i++){
      //					arr.push(this.policylist[i])
      //					arr[i].delete_show=false
      //				}
      //				console.log(arr)
      //				this.policylist=arr
      this.$refs[val][0].doClose();
    },
    //删除政策
    deletepolicy(val, e, refss) {
      console.log(val);
      let params = {
        //policyBatchType: 1,
        policyId: val
        //policyItemRatesID: val.policyItemRateId,
      };
      this.post(params, "services/app/policy/DeletePolicy").then(res => {
        console.log(res);
        if (res.success) {
          this.$notify({
            title: "删除成功",
            message: "您已成功删除一条政策",
            type: "success",
            customClass: "el-notification-success"
          });
          this.$refs[refss][0].doClose();
          this.policylist.splice(e, 1);
          if(this.policylist.length == 0){
            this.isNull = true;
          }
        } else {
          this.$notify.error({
            title: "错误",
            message: res.error.message
          });
        }
      });
    },
    //判断moresave
    nowmoresave() {
      let aa = false;
      this.policylist.map(item => {
        if (item.isbackshow) {
          aa = true;
        }
        if (item.extends.length != 0) {
          item.extends.map(val => {
            if (val.isbackshow) {
              aa = true;
            }
          });
        }
      });
      this.moresave = aa;
    },

    //修改扩展信息
    subpolicyextends(item, indexout, index) {
      let obj = {
        policyItemRateId: item.policyItemRateId,
        lowerBrokerageBusiness: item.lowerBrokerageBusiness,
        lowerRewardBusiness: item.lowerRewardBusiness,
        lowerBrokerageTraffic: item.lowerBrokerageTraffic,
        lowerRewardTraffic: item.lowerRewardTraffic,
        lowerBrokerageVehicleTax: item.lowerBrokerageVehicleTax,
        lowerRewardVehicleTax: item.lowerRewardVehicleTax
      };

      if (item.isfront || item.issecon) {
        this.$message({
          message: "数据不对",
          type: "warning"
        });
      } else {
        this.loading2 = true;
        let arr = [];
        arr.push(obj);
        let params = {
          batchID: this.id,
          items: arr
        };
        this.post(params, "services/app/policy/LowerUpdate").then(rs => {
          if (rs.success) {
            console.log("success");
            console.log(rs);
            //this.getPolicyList()
            this.$notify({
              title: "修改成功",
              message: "您已修改成功",
              type: "success",
              customClass: "el-notification-success"
            });
            Vue.set(
              this.policylist[indexout].extends[index],
              "isbackshow",
              false
            );
            Vue.set(this.policylist[indexout].extends[index], "change1", false);
            Vue.set(this.policylist[indexout].extends[index], "change2", false);
            Vue.set(this.policylist[indexout].extends[index], "change3", false);
            Vue.set(this.policylist[indexout].extends[index], "change4", false);
            Vue.set(this.policylist[indexout].extends[index], "change5", false);
            let str = JSON.stringify(this.policylist[indexout].extends[index]);
            Vue.set(
              this.copypolicylist[indexout].extends,
              index,
              JSON.parse(str)
            );
            this.nowmoresave();

            this.loading2 = false;
          } else {
            this.loading2 = false;
            this.$notify.error({
              title: "错误",
              message: res.error.message
            });
          }
        });
      }
    },
    moresaves() {
      if (this.moresave) {
        console.log(this.policylist);
        let arr = [];
        let aa = false;
        this.policylist.map(item => {
          if (item.isbackshow) {
            item.extendID = item.policyItemRateId;
            arr.push(item);
          }
          if (item.isfront || item.issecon) {
            aa = true;
          }
          item.extends.map(val => {
            if (val.isbackshow) {
              val.extendID = val.policyItemRateId;
              arr.push(val);
            }
            if (val.isfront || val.issecon) {
              aa = true;
            }
          });
        });
        if (aa == true) {
          this.$message({
            message: "数据不对",
            type: "warning"
          });
        } else {
          var txt = "确定批量保存吗？";
          this.$confirm(txt, "保存提示", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            closeOnClickModal: false
            // type: 'warning'
          }).then(() => {
            let params = {
              batchID: this.id,
              items: arr
            };
            this.post(params, "services/app/policy/LowerUpdate").then(rs => {
              if (rs.success) {
                console.log("success");
                console.log(rs);
                this.getPolicyList();
                this.$notify({
                  title: "修改成功",
                  message: "您已修改成功",
                  type: "success",
                  customClass: "el-notification-success"
                });
                this.moresave = false;
              } else {
                this.$notify.error({
                  title: "错误",
                  message: rs.error.message
                });
              }
            });
          });
        }
      }
    },
    //修改单挑政策数据
    subpolicy(item, index) {
      let obj = {
        policyItemRateId: item.policyItemRateId,
        lowerBrokerageBusiness: item.lowerBrokerageBusiness,
        lowerRewardBusiness: item.lowerRewardBusiness,
        lowerBrokerageTraffic: item.lowerBrokerageTraffic,
        lowerRewardTraffic: item.lowerRewardTraffic,
        lowerBrokerageVehicleTax: item.lowerBrokerageVehicleTax,
        lowerRewardVehicleTax: item.lowerRewardVehicleTax
      };

      if (item.isfront || item.issecon) {
        this.$message({
          message: "数据不对",
          type: "warning"
        });
      } else {
        this.loading2 = true;
        let arr = [];
        arr.push(obj);
        let params = {
          batchID: this.id,
          items: arr
        };
        this.post(params, "services/app/policy/LowerUpdate").then(rs => {
          if (rs.success) {
            console.log("success");
            console.log(rs);
            //this.getPolicyList()
            this.$notify({
              title: "修改成功",
              message: "您已修改成功",
              type: "success",
              customClass: "el-notification-success"
            });
            Vue.set(this.policylist[index], "isbackshow", false);
            Vue.set(this.policylist[index], "change1", false);
            Vue.set(this.policylist[index], "change2", false);
            Vue.set(this.policylist[index], "change3", false);
            Vue.set(this.policylist[index], "change4", false);
             Vue.set(this.policylist[index], "change5", false);
            let str = JSON.stringify(this.policylist[index]);
            Vue.set(this.copypolicylist, index, JSON.parse(str));
            this.nowmoresave();

            this.loading2 = false;
          } else {
            this.loading2 = false;
            this.$notify.error({
              title: "错误",
              message: res.error.message
            });
          }
        });
      }
    },

    //驳回确定
    toDis_sure(formName) {
      if (this.dismissalSeason == "") {
        this.$message({
          message: "驳回原因不能为空",
          type: "warning"
        });
        return false;
      }
      this.loading6 = true;
      let params = {
        policyBatchId: this.id,
        dismissalSeason: this.dismissalSeason
      };
      this.loading6 = true;
      this.post(
        params,
        "services/app/policy/UpdatePolicyBatchStateToDismissal"
      ).then(res => {
        if (res.success) {
          this.loading6 = false;
          this.$notify({
            title: "成功",
            message: "已驳回",
            type: "success"
          });
					if(this.$route.query.isback){
						this.$router.push({
	            name: "policydown"
	          });
					}else{
						this.$router.go(-1)
					}
          
          this.Rejectshow = false;
        } else {
          this.loading6 = false;
          this.failNot(res.error.message);
        }
      });
    },
    //添加下游政策
    addlowpolic(val) {
      console.log(val);
      this.indexs = null;
      this.indexs_tow = null;
      let arr = [];
      Vue.set(this.json, "targetId", arr);
      this.isshow = true;
      Vue.set(this.json, "premiumType", val.upperPremiumType); //				premiumType: "1", //保费类型
      console.log(this.Maidlist);
      Vue.set(
        this.json,
        "brokerageBusinessType",
        val.upperBrokerageBusinessType
      );
      Vue.set(this.json, "chargeType", val.upperChargeType);

      Vue.set(this.json, "policyItemId", val.policyId);
      Vue.set(this.json, "lowerBrokerageTraffic", 0);
      Vue.set(this.json, "lowerRewardTraffic", 0);
      Vue.set(this.json, "lowerBrokerageBusiness", 0);
      Vue.set(this.json, "lowerRewardBusiness", 0);
      Vue.set(this.json, "lowerBrokerageVehicleTax", 0);
      this.gethomes(val.policyId);
      this.getuesr(val.policyId);
    },
    //提交审核
    toexamine() {
      console.log(1111111111111);
      console.log(this.existence);
      if(this.moresave){
      	this.$confirm("你有未保存数据，确认提交审核吗", "审核提示", {
							confirmButtonText: "确定",
							cancelButtonText: "取消",
							closeOnClickModal: false
							// type: 'warning'
						}).then(() => {
						 this.toRovalPost();
						}).catch(()=>{
							
							 //this.indexActive=null
						})
      }else{
      	 var txt = "确定提交审核吗？";
	      this.$confirm(txt, "审核提示", {
	        confirmButtonText: "确定",
	        cancelButtonText: "取消",
	        closeOnClickModal: false
	        // type: 'warning'
	      }).then(() => {
	        this.toRovalPost();
	      });
      }
      
      
      //	if(this.existence.length == 0){
      //无冲突
     
      //				}else{
      //					this.dialogTableVisible=true
      //				}
    },
    //去修改
    goEdit() {
      this.dialogTableVisible = false;
    },
    //去修改
    ex_goEdit() {
      this.ex_dialogTableVisible = false;
    },
    //继续提交
    toRoval_sure() {
      this.dialogTableVisible = false;
      this.editbatch();
      this.toupdate();
    },
    //更新状态
    toupdate() {
      let IsReward = this.copyinfo.isReward ? 1 : 0;
      let params = {
      	id: this.newid
//      staffs: this.copyinfo.staffId,
//      effectiveDate: this.copyinfo.effectiveDate,
//      expiryDate: this.copyinfo.expiryDate,
//      isUpperBatch: 0,
//      IsReward: IsReward
      };
      this.post(
        params,
        "services/app/policy/UpdateExpiryDateCreatePolicyBatchNew"
      ).then(res => {
        if (res.success) {
          console.log("更新成功");
        } else {
          this.$notify.error({
            title: "错误",
            message: res.error.message
          });
        }
      });
    },
    //查看冲突
    isconflict() {
      let IsReward = this.copyinfo.isReward ? 1 : 0;
      console.log(this.copyinfo);
      let params = {
        staffs: this.copyinfo.staffId,
        effectiveDate: this.copyinfo.effectiveDate,
        expiryDate: this.copyinfo.expiryDate,
        isUpperBatch: 1,
        IsReward: IsReward,
        PolicyBatchId: this.id
      };
      this.post(
        params,
        "services/app/policy/CheckEffectivedCreatePolicyBatchNew"
      ).then(res => {
        if (res.success) {
          console.log("chongtu");
          console.log(res);
          			if(res.result.code == 0) {
							//无冲突
							this.getdatas()
						} else if(res.result.code == -1 || res.result.code == -2) {
							//有冲突 不能提交
							this.candialogTableVisible = true
							this.nowmessage = res.result.message
							this.existence = res.result.items

						} else {
							//有冲突 解决冲突
              this.dialogTableVisible = true
              	this.nowmessage = res.result.message
							this.existence = res.result.items
							this.newid = res.result.id
						}
//        this.existence = res.result.items;
//        if (res.result.items.length > 0) {
//          //冲突
//          //有冲突
//          this.dialogTableVisible = true;
//        } else {
//          //不冲突
//          this.editbatch();
//        }
        } else {
          this.$notify.error({
            title: "错误",
            message: res.error.message
          });
        }
      });
    },
    //继续提交
    ex_toRoval_sure() {
      this.ex_dialogTableVisible = false;
      this.adpass();
      this.Updatestate();
    },
    //无冲突提交
    toRovalPost() {
      let params = {
        policyBatchId: this.id
      };
      this.loading4 = true;
      this.post(
        params,
        "services/app/policy/UpdatePolicyBatchStateToApprovalPending"
      ).then(re => {
        if (re.success) {
          this.rovalHtml = "已提交";
          this.rovalDisa = true;
          this.loading4 = false;
          this.$notify({
            title: "提交成功",
            message: "您已成功提交审核",
            type: "success",
            customClass: "el-notification-success"
          });
           if(this.$route.query.isback){
						this.$router.push({
	            name: "policydown"
	          });
					}else{
						this.$router.go(-1)
					}
        } else {
          this.loading4 = false;
          this.failNot(re.error.message);
        }
      });
    },
    //删除批次
    deletebatch() {
      let params = {
        id: this.id
      };
      var txt = "此操作将永久删除该政策批次, 是否继续？";
      this.$confirm(txt, "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        closeOnClickModal: false
        // type: 'warning'
      }).then(() => {
        this.post(params, "services/app/policy/DeletePolicyBatch").then(re => {
          if (re.success) {
            console.log(re);
            this.$notify({
              title: "删除成功",
              message: "您已成功删除一条下游批次",
              type: "success",
              customClass: "el-notification-success"
            });
            if(this.$route.query.isback){
						this.$router.push({
	            name: "policydown"
	          });
					}else{
						this.$router.go(-1)
					}
          } else {
            this.failNot(re.error.message);
          }
        });
      });
    },
    //申请编辑
    Applicationeditor() {
      let params = {
        policyBatchId: this.id
      };

      var txt = "确定申请编辑吗？";
      this.$confirm(txt, "审核提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        closeOnClickModal: false
        // type: 'warning'
      }).then(() => {
        this.loading5 = true;
        this.post(
          params,
          "services/app/policy/UpdatePolicyBatchStateToEditing"
        ).then(re => {
          if (re.success) {
            this.loading5 = false;
            console.log(re);
            this.successNot();
             if(this.$route.query.isback){
						this.$router.push({
	            name: "policydown"
	          });
					}else{
						this.$router.go(-1)
					}
          } else {
            this.loading5 = false;
            this.failNot(re.error.message);
          }
        });
      });
    },
    //生成下游政策
    generate() {},

    //通过
    adopt() {
      //	if(this.existence.length == 0){
      //无冲突
      var txt = "确定通过审核吗？";
      this.$confirm(txt, "审核提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        closeOnClickModal: false
        // type: 'warning'
      }).then(() => {
        this.adpass();
      });
      //					}else{
      //						this.ex_dialogTableVisible=true
      //					}
    },
    //通过2
    adpass() {
      this.loading6 = true;
      let params = {
        policyBatchId: this.id
      };
      this.post(
        params,
        "services/app/policy/UpdatePolicyBatchStateToApproval"
      ).then(re => {
        if (re.success) {
          console.log(re);
          this.loading6 = false;
          // this.successNot();
           var txt = "审核成功，系统将重新计算对应保单的政策。";
            this.$alert(txt, "成功", {
              confirmButtonText: "确定",
              closeOnClickModal: false,
              showClose:false
              // type: 'warning'
            }).then(() => {
              if(this.$route.query.isback){
                this.$router.push({
                    name: "policydown"
                  });
                }else{
                  this.$router.go(-1)
                }
            });
        } else {
          this.loading6 = false;
          this.failNot(re.error.message);
        }
      });
    },

    //驳回
    reject() {
      this.Rejectshow = true;
      Vue.set(this.ruleForm, "dismissalSeason", "");
    },
    //保存成功提示
    successNot() {
      this.$notify({
        title: "提交成功",
        message: "您已成功提交一条下游批次",
        type: "success",
        customClass: "el-notification-success"
      });
    },
    //保存失败提示
    failNot(message) {
      this.$notify.error({
        title: "保存失败",
        message: message,
        duration: 0,
        customClass: "el-notification-error"
      });
    },
    //编辑批次信息
    editbatch() {
      this.loading1 = true;
      let params = {
        id: this.id,
        batchName: this.copyinfo.batchName,
        upperBatchID: this.copyinfo.upperBatchID,
        staffId: this.copyinfo.staffId,
        effectiveDate: this.copyinfo.effectiveDate,
        expiryDate: this.copyinfo.expiryDate,
        insuranceId: this.copyinfo.insuranceId
      };
      console.log(params);
      this.post(params, "services/app/policy/CreateLowerPolicyBatch").then(
        res => {
          if (res.success) {
            this.loading1 = false;
            console.log("更改批次信息");
            console.log(res);
            this.getBasic();
            this.isshows = false;
          } else {
            this.loading1 = false;
            this.$notify.error({
              title: "错误",
              message: res.error.message
            });
          }
        }
      );
    },
    //编辑基本嘻嘻
    btn(formName) {
      var stringTime1 = this.copyinfo.effectiveDate;
      var stringTime2 = this.copyinfo.expiryDate;
      var timestamp1 = Date.parse(new Date(stringTime1));
      var timestamp2 = Date.parse(new Date(stringTime2));
      this.copyinfo.id = this.id;
      //this.copyinfo.id=this.id
      this.$refs[formName].validate(valid => {
        if (valid) {
          if (this.copyinfo.expiryDate) {
            if (timestamp1 <= timestamp2) {
              //this.nowsubmits()
              this.errormsg = {
                beginerror: false,
                enderror: false,
                message: ""
              };
               //查看冲突
            this.isconflict();
             //不查看冲突
             // this.editbatch();
            } else {
              this.errormsg = {
                beginerror: true,
                enderror: true,
                message: "开始时间不能大于结束时间"
              };
            }
          } else {
            this.errormsg = {
              beginerror: false,
              enderror: false,
              message: ""
            };
            //查看冲突
           this.isconflict();
             //不查看冲突
             // this.editbatch();
          }
        } else {
          console.log(444);
          return false;
        }
      });
    },
    batchedit() {
      console.log(this.workoptions);
      let str = JSON.stringify(this.info);
      this.copyinfo = JSON.parse(str);
      let arr = [];
      for (let i = 0; i < this.copyinfo.staffNames.length; i++) {
        arr.push(this.copyinfo.staffNames[i].staffId);
      }
      Vue.set(this.copyinfo, "staffId", arr);
      console.log(this.copyinfo);
      this.isshows = true;
    },
    //获取公司列表
    getcommoy() {
      let params = {};
      this.post(params, "services/app/common/GetGroupInsurances").then(res => {
        this.options = res.result.items;
      });
    },
    //获取工号
    getWorknumber() {
      let params = {
        id: this.copyinfo.insuranceId
      };
      //Vue.set(this.copyinfo,"staffId",[])
      this.post(params, "services/app/common/GetCurrentInsuranceStaffs").then(
        res => {
          var arr = [];
          console.log("--------------");
          //this.workoptions
          arr = res.result.items;
          for (var i = 0; i < arr.length; i++) {
            if (arr[i].describe != "") {
              arr[i].staffAccount =
                arr[i].staffAccount + " (" + arr[i].describe + ")";
            } else {
              arr[i].staffAccount = arr[i].staffAccount;
            }
          }
          this.workoptions = arr;
        }
      );
    },
    //信息
    getBasic() {
      let params = {
        id: this.id
      };
      this.post(params, "services/app/policy/GetPolicyBatchBasic").then(rs => {
        if (rs.success) {
          console.log("success_shuju");
          console.log(rs.result);
          this.info = rs.result;
          this.info.upperBatchID = rs.result.referId;
          this.copyinfo.insuranceId = rs.result.insuranceId;
          if (this.info.state == 0 || this.info.state == 5) {
            this.iscanedit = false;
          } else {
            this.iscanedit = true;
          }
          this.getWorknumber();
          //默认工号列表
          this.copyinfo.staffId = rs.result.staffNames;
          for (var i = 0; i < this.copyinfo.staffId.length; i++) {
            if (this.copyinfo.staffId[i].describe != "") {
              this.copyinfo.staffId[i].staffAccount =
                this.copyinfo.staffId[i].staffAccount +
                " (" +
                this.copyinfo.staffId[i].describe +
                ")";
            } else {
              this.copyinfo.staffId[i].staffAccount = this.copyinfo.staffId[
                i
              ].staffAccount;
            }
          }
          if (this.info.expiryDate) {
            this.islimit = false;
          } else {
            this.islimit = true;
          }
          this.getcommoy();
          //默认政策
          this.getuppoliy(rs.result.insuranceId);
        }
      });
      this.post(params, "services/app/policy/CheckEffectivedPolicyBatch").then(
        res => {
          if (res.success) {
            this.existence = res.result.items;
          } else {
            this.$notify.error({
              title: "错误",
              message: res.error.message
            });
          }
        }
      );
    },
    //获取下游政策批次
    getuppoliy(val) {
      console.log(val);
      let params = {
        insuranceId: val
      };
      this.post(params, "services/app/policy/GetUpperHistoryBatchList").then(
        res => {
          if (res.success) {
            console.log("upnum");
            console.log(res);
            this.uppoliy = res.result.items;
          } else {
            this.$notify.error({
              title: "错误",
              message: res.error.message
            });
          }
        }
      );
    },
    //展示
    isdetailshow(e, val) {
      console.log(val);
      if (val.detailshow == false) {
        this.getshowdetail(e,val);
      }

      let arr = [];
      this.policylist.map((item, index) => {
        arr.push(item);
        if (index == e) {
        	Vue.set(arr[index], "loadings", true);
          Vue.set(arr[index], "detailshow", !arr[index].detailshow);
        }
//      else {
//        Vue.set(arr[index], "detailshow", false);
//      }
      });
      this.policylist = arr;
      console.log(this.policylist);
    },
    //信息表
    getPolicyList() {
      let params = {
        //'id':'AFE5BBB3-9E30-46D2-9166-03316C65092D'
        id: this.id
      };
      this.post(params, "services/app/policy/GetAllPolicyList").then(rs => {
        if (rs.success) {
          console.log("biaoshuju");
          console.log(rs.result.items);
          if(rs.result.items.length == 0){
            this.isNull = true;
          }
          this.policylist = rs.result.items;
          let re = /^[0-9]+.?[0-9]*/;
          this.policylist.forEach(item => {
            if (item) {
              item.hovershow = false;
              item.Lowerpassiseditshow = false;
              item.isbackshow = false;
              item.isfront = false;
              item.issecon = false;
              item.change1 = false;
              item.change2 = false;
              item.change3 = false;
              item.change4 = false;
               item.change5 = false;
              item.detailshow = false;
              item.delete_show = false;
              item.loadings=true
              if (item.extends.length != 0) {
                item.extends.map(val => {
                  val.hovershow = false;
                  item.isbackshow = false;
                  item.isfront = false;
                  item.issecon = false;
                  item.change1 = false;
                  item.change2 = false;
                  item.change3 = false;
                  item.change4 = false;
                  item.change5 = false;
                });
              }
            }
          });
          let str = JSON.stringify(this.policylist);
          this.copypolicylist = JSON.parse(str);
          let arr = rs.result.items;
          this.snumbers = [];
             // 次序
          for(let i=0;i<arr.length;i++){
            let obj = {
              label:i+1,
              value:i+1,
              id:arr[i].policyId
            }
            this.snumbers.push(obj);
          }
          console.log(this.snumbers);
        }
      });
    },
    //扩展取消
    subfalseextend(indexout, index) {
      let str = JSON.stringify(this.copypolicylist[indexout].extends[index]);
      Vue.set(this.policylist[indexout].extends, index, JSON.parse(str));
      this.nowmoresave();
    },
    //下通取消编辑
    //取消
    subfalse(index) {
      let str = JSON.stringify(this.copypolicylist[index]);
      Vue.set(this.policylist, index, JSON.parse(str));
      //				var aa=false
      //				this.policylist.map(item =>{
      //					if(item.isbackshow){
      //						aa=true
      //
      //					}
      //				})
      //				this.moresave=aa
      this.nowmoresave();
    },
    //扩展input
    getchange_extendnum(val, indexout, index, name, types) {
      let aa = this.api.clearNoNum_target(val, 100, types);
      console.log(aa);
      Vue.set(this.policylist[indexout].extends[index], name, aa);
      Vue.set(this.policylist[indexout].extends[index], "isbackshow", true);
      this.moresave = true;
      //lowerRewardTraffic
      let a1 = parseFloat(
        this.policylist[indexout].extends[index].lowerBrokerageTraffic
      );
      let a2 = parseFloat(
        this.policylist[indexout].extends[index].lowerRewardTraffic
      );
      let a3 = parseFloat(
        this.policylist[indexout].extends[index].lowerBrokerageBusiness
      );
      let a4 = parseFloat(
        this.policylist[indexout].extends[index].lowerRewardBusiness
      );
      if (name == "lowerBrokerageTraffic") {
        Vue.set(this.policylist[indexout].extends[index], "change1", true);
      }
      if (name == "lowerRewardTraffic") {
        Vue.set(this.policylist[indexout].extends[index], "change2", true);
      }
      if (name == "lowerBrokerageBusiness") {
        Vue.set(this.policylist[indexout].extends[index], "change3", true);
      }
      if (name == "lowerRewardBusiness") {
        Vue.set(this.policylist[indexout].extends[index], "change4", true);
      }
      if (name == "lowerBrokerageVehicleTax") {
        Vue.set(this.policylist[indexout].extends[index], "change5", true);
      }
      if (types == 0) {
        if (a1 + a2 > 100) {
          Vue.set(this.policylist[indexout].extends[index], "isfront", true);
        } else {
          Vue.set(this.policylist[indexout].extends[index], "isfront", false);
        }
        if (a3 + a4 > 100) {
          Vue.set(this.policylist[indexout].extends[index], "issecon", true);
        } else {
          Vue.set(this.policylist[indexout].extends[index], "issecon", false);
        }
      }
    },
    //下通input
    getchange_num(val, index, name, types) {
      let aa = this.api.clearNoNum_target(val, 100, types);
      Vue.set(this.policylist[index], name, aa);
      Vue.set(this.policylist[index], "isbackshow", true);
      this.moresave = true;
      let a1 = parseFloat(this.policylist[index].lowerBrokerageTraffic);
      let a2 = parseFloat(this.policylist[index].lowerRewardTraffic);
      let a3 = parseFloat(this.policylist[index].lowerBrokerageBusiness);
      let a4 = parseFloat(this.policylist[index].lowerRewardBusiness);
      if (name == "lowerBrokerageTraffic") {
        Vue.set(this.policylist[index], "change1", true);
      }
      if (name == "lowerRewardTraffic") {
        Vue.set(this.policylist[index], "change2", true);
      }
      if (name == "lowerBrokerageBusiness") {
        Vue.set(this.policylist[index], "change3", true);
      }
      if (name == "lowerRewardBusiness") {
        Vue.set(this.policylist[index], "change4", true);
      }
      if (name == "lowerBrokerageVehicleTax") {
        Vue.set(this.policylist[index], "change5", true);
      }
      if (types == 0) {
        if (a1 + a2 > 100) {
          Vue.set(this.policylist[index], "isfront", true);
        } else {
          Vue.set(this.policylist[index], "isfront", false);
        }
        if (a3 + a4 > 100) {
          Vue.set(this.policylist[index], "issecon", true);
        } else {
          Vue.set(this.policylist[index], "issecon", false);
        }
      }
    },
    //两位小数
    twoBit(value) {
      if (value) {
        console.log(value);
        value = value.replace(/[^\d.]/g, ""); //清除“数字”和“.”以外的字符
        value = value.replace(/\.{2,}/g, "."); //只保留第一个. 清除多余的
        value = value
          .replace(".", "$#$")
          .replace(/\./g, "")
          .replace("$#$", ".");
        value = value.replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3"); //只能输入两个小数
        if (value.indexOf(".") < 0 && value != "") {
          //以下已经过滤，此处控制的是如果没有小数点，首位不能为类似于 01、02的金额
          value = parseFloat(value);
        }
        // value = value;
        return value;
      }
    },
    //验证小数
    getTest(item) {
      console.log(item);
      const that = this;
      // let re = /^[0-9\.]+$/g;
      let re2 = /^\d+(\.\d{1,2})?$/;
      for (let i in item) {
        if (
          i == "lowerBrokerageTraffic" ||
          i == "lowerRewardTraffic" ||
          i == "lowerBrokerageBusiness" ||
          i == "lowerRewardBusiness"
        ) {
          if (!re2.test(item[i])) {
            Vue.set(item, i, that.twoBit(item[i]));
            this.getchange(item);
            // console.warn(item[i]);
          }
        }
      }
    },
    //验证100
    getchange(item) {
      console.log(item);
      const that = this;
      let re = /^[0-9]+.?[0-9]*/;
      for (var i in item) {
        if (item[i] === "") {
          item[i] = "0";
        }
        if (re.test(item[i])) {
          if (i == "lowerBrokerageTraffic") {
            if (Number(item[i]) + Number(item["lowerRewardTraffic"]) > 100) {
              Vue.set(item, "traffic", true);
            } else {
              Vue.set(item, "traffic", false);
            }
            if (Number(item[i]) > 100) {
              Vue.set(item, "traffic1", true);
            } else {
              Vue.set(item, "traffic1", false);
            }
          }
          if (i == "lowerRewardTraffic") {
            if (Number(item[i]) + Number(item["lowerBrokerageTraffic"]) > 100) {
              Vue.set(item, "traffic", true);
            } else {
              Vue.set(item, "traffic", false);
            }
            if (Number(item[i]) > 100) {
              Vue.set(item, "traffic2", true);
            } else {
              Vue.set(item, "traffic2", false);
            }
          }
          if (i == "lowerBrokerageBusiness") {
            if (Number(item[i]) + Number(item["lowerRewardBusiness"]) > 100) {
              Vue.set(item, "business", true);
            } else {
              Vue.set(item, "business", false);
            }
            if (Number(item[i]) > 100) {
              Vue.set(item, "business1", true);
            } else {
              Vue.set(item, "business1", false);
            }
          }
          if (i == "lowerRewardBusiness") {
            if (
              Number(item[i]) + Number(item["lowerBrokerageBusiness"]) >
              100
            ) {
              Vue.set(item, "business", true);
            } else {
              Vue.set(item, "business", false);
            }
            if (Number(item[i]) > 100) {
              Vue.set(item, "business2", true);
            } else {
              Vue.set(item, "business2", false);
            }
          }
        }
      }
    },
    //遍历，空为0
    eachArr4(arr) {
      let re = /^[0-9]+.?[0-9]*/;
      arr.forEach(item => {
        if (item) {
          for (var i in item) {
            if (re.test(item[i])) {
              if (item[i] == "") {
                item[i] = "0";
              }
            }
            if (
              i == "upperBrokerageTraffic" &&
              item["upperBrokerageTraffic"] == ""
            ) {
              item[i] = "0";
              console.log(item[i]);
            }
            if (i == "upperRewardTraffic" && item["upperRewardTraffic"] == "") {
              item[i] = "0";
            }
            if (
              i == "upperBrokerageBusiness" &&
              item["upperBrokerageBusiness"] == ""
            ) {
              item[i] = "0";
            }
            if (
              i == "upperRewardBusiness" &&
              item["upperRewardBusiness"] == ""
            ) {
              item[i] = "0";
            }
            if (
              i == "lowerBrokerageTraffic" &&
              item["lowerBrokerageTraffic"] == ""
            ) {
              item[i] = "0";
            }
            if (i == "lowerRewardTraffic" && item["lowerRewardTraffic"] == "") {
              item[i] = "0";
            }
            if (
              i == "lowerBrokerageBusiness" &&
              item["lowerBrokerageBusiness"] == ""
            ) {
              item[i] = "0";
            }
            if (
              i == "lowerRewardBusiness" &&
              item["lowerRewardBusiness"] == ""
            ) {
              item[i] = "0";
            }
            if (item["extends"]) {
              item["extends"].forEach(ins => {
                if (ins) {
                  for (var j in ins) {
                    if (re.test(ins[j])) {
                      if (ins[j] == 0) {
                        ins[j] = "";
                      }
                    }
                    if (
                      j == "lowerBrokerageTraffic" &&
                      item["lowerBrokerageTraffic"] == ""
                    ) {
                      ins[j] = "0";
                    }
                    if (
                      j == "lowerRewardTraffic" &&
                      item["lowerRewardTraffic"] == ""
                    ) {
                      ins[j] = "0";
                    }
                    if (
                      j == "lowerBrokerageBusiness" &&
                      item["lowerBrokerageBusiness"] == ""
                    ) {
                      ins[j] = "0";
                    }
                    if (
                      j == "lowerRewardBusiness" &&
                      item["lowerRewardBusiness"] == ""
                    ) {
                      ins[j] = "0";
                    }
                  }
                }
              });
            }
          }
        }
      });
      return arr;
    },

    //详情
    toDetail(val,see) {
      console.log(this.$route);
      //dawn_policydowninfo
      let filterType;
      if(see == '02'){
        filterType = 1
      }else{
        filterType = 0
      }
      if (this.$route.name == "policylower3_list") {
        console.log("应该是走这里没错的啊")
        this.$router.push({
          name: "down_policydowninfo",
          query: {
            batchId: this.id,
            policyId: val,
            status: this.info.state,
            stream: 2,
            Jurisdiction: this.Jurisdiction,
            filterType: filterType
          }
        });
      } else {
        this.$router.push({
          name: "adddown_policydowninfo",
          query: {
            batchId: this.id,
            policyId: val,
            status: this.info.state,
            stream: 2,
            Jurisdiction: this.Jurisdiction,
            filterType:filterType
          }
        });
      }
    },
    tocopy(ids) {
      if (this.$route.name == "policylower3_list") {
        this.$router.push({
          name: "down_policydowninfo",
          query: {
            batchId: this.id,
            policyId: ids,
            status: this.info.state,
            stream: 2,
            Jurisdiction: this.Jurisdiction,
            iscopy: true
          }
        });
      } else {
        this.$router.push({
          name: "adddown_policydowninfo",
          query: {
            batchId: this.id,
            policyId: ids,
            status: this.info.state,
            stream: 2,
            Jurisdiction: this.Jurisdiction,
            iscopy: true
          }
        });
      }
    },
    toEdit() {
      this.$router.push({
        name: "down_policydowninfo",
        query: {
          batchId: this.id,
          stream: 2,
          Jurisdiction: this.Jurisdiction
        }
      });
    },
    //编辑
    setNew(id) {
      this.json.policyItemId = id;
      let arr = [];
      Vue.set(this.json, "targetId", arr);
      this.isshow = true;
      console.log(11111);
      console.log(this.json.targetId instanceof Array);
      //this.getUnits()
    },
    //----------------------dialog
    //用户信息
    getuesr(val) {
      let params = {
        id: val
      };
      this.post(params, "services/app/policy/ChildUsers").then(rs => {
        console.log(rs);
        if (rs.success) {
          console.log("success");
          console.log(rs);
          this.userlist = rs.result.users;
        }
      });
    },
    //组织机构
    getUnits() {
      let params = {};
      this.post(params, "services/app/common/GetCurrentOrganizationUnits").then(
        rs => {
          console.log(rs);
          if (rs.success) {
            let data = rs.result;
            let arr = [];
            arr.push(data);
            this.treeData = arr;
            // console.log(rs.result);
            // console.log(this.treeData);
            // console.log('-----------');
          }
        }
      );
    },
    //			//tree
    //			setSelectedId(val) {
    //				console.log(val);
    //				this.json.targetId = val;
    //			},

    submits(formName) {
      let a1 = parseFloat(this.json.lowerBrokerageTraffic);
      let a2 = parseFloat(this.json.lowerRewardTraffic);
      let b1 = parseFloat(this.json.lowerBrokerageBusiness);
      let b2 = parseFloat(this.json.lowerRewardBusiness);
      console.log(this.json);
      this.$refs[formName].validate(valid => {
        if (valid) {
          if (this.json.brokerageBusinessType == 0) {
            if (a1 + a2 > 100 && b1 + b2 > 100) {
              this.indexs_tow = 2;
              this.indexs = 1;
            } else if (a1 + a2 > 100 || b1 + b2 > 100) {
              if (a1 + a2 > 100) {
                this.indexs = 1;
                this.indexs_tow = null;
              } else {
                this.indexs_tow = 2;
                this.indexs = null;
              }
            } else {
              this.indexs_tow = null;
              this.indexs = null;
              console.log(this.json);
              this.json.targetId = this.json.targetId.join(",");
              let arr = [];
              arr.push(this.json);
              let params = {
                extends: arr
              };
              this.loading2 = true;
              this.post(params, "services/app/policy/PolicyAddExtendInfo").then(
                rs => {
                  if (rs.success) {
                    this.loading2 = false;
                    console.log(rs);
                    this.getBasic();
                    this.getPolicyList();
                    this.$notify({
                      title: "提交成功",
                      message: "您已成功创建一条下游政策",
                      type: "success",
                      customClass: "el-notification-success"
                    });
                  } else {
                    this.loading2 = false;
                    this.$notify.error({
                      title: "错误",
                      message: rs.error.message
                    });
                  }
                }
              );
              this.isshow = false;
            }
          } else {
            this.json.targetId = this.json.targetId.join(",");
            let arr = [];
            arr.push(this.json);
            let params = {
              extends: arr
            };
            this.loading2 = true;
            this.post(params, "services/app/policy/PolicyAddExtendInfo").then(
              rs => {
                if (rs.success) {
                  this.loading2 = false;
                  console.log(rs);
                  this.getBasic();
                  this.getPolicyList();
                  this.$notify({
                    title: "提交成功",
                    message: "您已成功创建一条下游政策",
                    type: "success",
                    customClass: "el-notification-success"
                  });
                } else {
                  this.loading2 = false;
                  this.$notify.error({
                    title: "错误",
                    message: rs.error.message
                  });
                }
              }
            );
            this.isshow = false;
          }
        } else {
          console.log("error submit!!");
          return false;
        }
      });
    },
    //批量添加子机构
    batchNew() {
       this.dialogTitle = "批量添加子机构政策"
       this.isSingle = false;
      this.batchDialog = true;
      this.gethomes(this.id);
    },
    //获取组织
    getChildhomes(val) {
      //organization
      let params = {
        id: val
      };
      this.post(params, "services/app/policy/ChildOrganizations").then(res => {
        if (res.success) {
          this.childorganization = res.result.child;
        } else {
          this.$notify.error({
            title: "错误",
            message: res.error.message
          });
        }
      });
    },
    //批量or单个新增子机构保存
    saveBatchchild(formName,val) {
    	console.log(formName)
    	console.log(val)
      const me = this;
      this.$refs[formName].validate(valid => {
        if (valid) {
          me.childloding = true
          let params = {
            policyBatchId: this.id,
            extendType: 1,
            targetId: this.batchChild.targetId
          };
          if(me.isSingle){
              params.policyId = this.childpolicyId
          }
          this.post(params, "services/app/policy/CreateLowerPolicyExtend").then(
            rs => {
              console.log(rs);
              if (rs.success) {
                this.$notify({
                  title: "添加成功",
                  message: "批量添加子机构政策成功",
                  type: "success",
                  customClass: "el-notification-success"
                });
                me.batchDialog = false;
                me.batchChild.targetId = '';
                me.getPolicyList();
                me.childloding = false
                this.$refs[val].doClose();
              }else{
                 this.$notify.error({
                  title: "错误",
                  message: res.error.message
                });
                  me.childloding = false
              }
            }
          );
        } else {
          console.log("验证不通过");
        }
      });
    },
    saveBatchchilds(formName,val) {
    	console.log(formName)
    	console.log(val)
      const me = this;
      this.$refs[formName][0].validate(valid => {
        if (valid) {
          me.childloding = true
          let params = {
            policyBatchId: this.id,
            extendType: 1,
            targetId: this.batchChild.targetId
          };
          if(me.isSingle){
              params.policyId = this.childpolicyId
          }
          this.post(params, "services/app/policy/CreateLowerPolicyExtend").then(
            rs => {
              console.log(rs);
              if (rs.success) {
                this.$notify({
                  title: "添加成功",
                  message: "批量添加子机构政策成功",
                  type: "success",
                  customClass: "el-notification-success"
                });
                me.batchDialog = false;
                me.batchChild.targetId = '';
                me.getPolicyList();
                me.childloding = false
                this.$refs[val][0].doClose();
              }else{
                 this.$notify.error({
                  title: "错误",
                  message: res.error.message
                });
                  me.childloding = false
              }
            }
          );
        } else {
          console.log("验证不通过");
        }
      });
    },
    //删除子机构
    deletChild(policyid,ratesid){
      const me = this;
       let params = {
        policyId: policyid,
        policyItemRatesID:ratesid
      };
      this.$confirm('您确定要删除子机构政策吗?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.post(params, "services/app/policy/DeleteExtendPolicy").then(res => {
              if (res.success) {
                 this.$notify({
                  title: "删除成功",
                  message: "删除子机构政策成功",
                  type: "success",
                  customClass: "el-notification-success"
                });
                me.getPolicyList();
              } else {
                this.$notify.error({
                  title: "错误",
                  message: res.error.message
                });
              }
            });
          
        })
      
    },
    //单个增加子机构
    singleAdd(policyId){
    	console.log(3333)
      this.childpolicyId = policyId
      this.dialogTitle = "添加子机构政策"
      this.isSingle = true;
      this.batchDialog = true;
      this.getChildhomes(policyId);
    },
    // 次序
			changeSelect(index,item){
				if(!this.iscanedit){
							if(this.moresave){
					this.$confirm("你有未保存数据，确认更改吗", "提示", {
							confirmButtonText: "确定",
							cancelButtonText: "取消",
							closeOnClickModal: false
							// type: 'warning'
						}).then(() => {
							 this.indexActive = index
						}).catch(()=>{
							
							 this.indexActive=null
						})
				}else{
				 this.indexActive = index
				}
				}
		
       
				
			},
			// 次序方法
			changeSelectIndex(val){
				console.log(val);
        console.log(this.snumbers);
        console.log(this.snumbers[this.indexActive].id);
				let params = {
					serialNumber : val,
					policyId :this.snumbers[this.indexActive].id,
					policyBatchId :this.id
				};
				this.post(params, "services/app/policy/PolicyItemSortSetting").then(rs => {
					if(rs.success) {
						this.$notify({
							title: "修改成功",
							message: "次序修改成功，刷新页面",
							type: "success",
							customClass: "el-notification-success"
						});
						this.indexActive = null;
						this.getPolicyList();
					}else{
						if(rs.error.code==1){
							this.$notify.error({
								title: "错误",
								message: "序号不能大于政策条目总条数"
							});
						}else if(rs.error.code==2){
							this.$notify.error({
								title: "错误",
								message: "序号不能小于1"
							});
						}else{
							this.$notify.error({
								title: "错误",
								message: rs.error.message
							});
						}
						
					}
				});
			}
  }
};
</script>
<style lang='scss' scoped>
.set10 {
  margin-right: 10px;
}
.set30 {
  margin-left: 30px;
}
* {
  box-sizing: border-box;
}
.Proportionedit_name input {
  border-radius: 4px;
  border: 1px solid #dcdfe6;
}
.content {
  width: 100%;

  overflow: auto;
  font-size: 12px;
}
.icon-lingxing{
    font-size: 8px;
    margin-right: 5px;
    color:#FF7819;
}
.inputs {
  width: 250px;
  font-size: 12px;
}

.numinp {
  width: 60px;
  margin-left: 5px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid #dcdfe6;
  padding-left: 5px;
}
.actives .numinp {
  border: 1px solid red;
}
.actives_tuo .numinp {
  border: 1px solid red;
}
.numcontent {
  width: 250px;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
}

.btns {
  display: flex;
  justify-content: center;
  margin-left: -150px;
  margin-top: 30px;
}

.actives .numinp input {
  border: 1px solid #f56c6c;
}
/*#f56c6c*/

.rh {
  float: right;
  height: 28px;
  span {
    display: inline-block;
    width: 80px;
  }
  selectone {
    display: inline-block;
  }
  .util-select {
    width: 190px;
  }
}
/*---------------------------------*/

.wd100 {
  width: 100px;
  height: 32px;
}

.setH {
  line-height: 40px;
  height: 40px;
  border-bottom: 1px solid #e8e8e8;
}

.setH:last-child {
  border-bottom: 0;
}

.app-container {
  .app-box {
    .p-detail {
      .p_title {
        font-size: 18px;
        color: #333;
        margin: 0 0 30px 0;
        display: flex;
        justify-content: flex-start;
        align-items: center;
        i {
          color: #ee6000;
          font-size: 18px;
          margin: 3px 12px 0 0;
        }
        .state {
          width: 50px;
          height: 20px;
          display: flex;
          justify-content: center;
          align-items: center;
          font-size: 12px;
          border-radius: 3px;
          color: #ffffff;
        }
        .state1 {
          background: #027dca;
        }
        .state2 {
          background: #389e0d;
        }
        .state3 {
          background: #666666;
        }
        .state4 {
          background: #ff7819;
        }
        .state5 {
          background: #cf1322;
        }
        .state6 {
          background: #389e0d;
        }
        .add {
          font-size: 10px;
          color: #fff;
          background: #ff9430;
          border-radius: 8px;
          width: 30px;
          height: 15px;
          display: inline-block;
          text-align: center;
          margin-right: 10px;
          transform: scale(0.9);
        }
      }
      .editbatch {
        position: absolute;
        width: 78px;
        height: 28px;
        font-size: 13px;
        color: #027dca;
        right: 0;
        top: -3px;
        padding: 0;
        border: 0;
        outline: none;
        cursor: pointer;
        display: flex;
        justify-content: flex-end;
      }
      .d-box {
        background: #eaf5fb;
        //width: 100%;
        min-height: 79px;
        padding: 15px 30px;
        position: relative;

        p {
          margin: 0;
          span {
            font-size: 13px;
            color: #95bacc;
          }
          .d-setc {
            color: #2e94c5;
          }
          .isF:first-child {
            display: none;
          }
        }
        p:nth-of-type(1) {
          margin-bottom: 8px;
        }
        .minflao {
          width: 100%;
          min-height: 28px;
          font-size: 13px;
          color: #95bacc;
          .isF:first-child {
            display: none;
          }
          .d-setc {
            color: #2e94c5;
            margin-top: 3px;
            display: block;
            float: left;
            line-height: 28px;
          }
          .minflao_first {
            margin-top: 3px;
            display: block;
            float: left;
            line-height: 28px;
          }
        }
      }
    }
    .tableinof .tecenter:last-child td {
      border-bottom: 0 !important;
    }
    .p-list {
      //width:100%;
      .util-table {
        //width:100%;
        border: 0;
        margin-top: 30px;
        //border-bottom:1px solid #e8e8e8;
        border-collapse: collapse;
        tr {
          th {
            background: #334750;
            color: #fff;
            border: 0;
            text-align: center;
          }
          td {
            tr {
              td {
                padding: 0;
                font-size: 14px;
                border-bottom: double #e8e8e8;
                .inputset {
                  background: #e8e8e8;
                  border: 1px solid #c3c1c1;
                  width: 45px;
                  height: 21px;
                  text-align: right;
                  color: #333333;
                  font-size: 12px;
                  padding: 3px;
                }
              }
            }
            padding: 0;
            font-size: 14px;
            border-bottom: double #e8e8e8;
            .inputset {
              background: #e8e8e8;
              border: 1px solid #c3c1c1;
              width: 45px;
              height: 21px;
              text-align: right;
              color: #333333;
              font-size: 12px;
              padding: 3px;
            }
            span {
              font-size: 13px;
            }
            .setred {
              border: 1px solid #ff0000;
            }
            a {
              color: #027dca;
              font-size: 13px;
            }
            .addN {
              font-size: 14px;
              color: #027dca;
              cursor: pointer;
            }
          }
          .setc {
            text-align: center;
            padding: 0;
            .spanset {
              display: block;
              line-height: 40px;
              height: 40px;
              text-align: center;
              color: #333333;
              border-bottom: 1px solid #e8e8e8;
            }
            .setg {
              color: #019f6c;
              font-size: 12px;
              line-height: 40px;
              height: 40px;
              min-width: 100px;
              display: block;
              border-bottom: 1px solid #e8e8e8;
              span {
                color: #019f6c;
                font-size: 12px;
              }
            }
            .setg:last-child {
              border-bottom: 0;
            }
            .setr {
              color: #ff0000;
              font-size: 12px;
              line-height: 40px;
              height: 40px;
              display: block;
              border-bottom: 1px solid #e8e8e8;
            }
          }
        }
      }
    }
    .p-btn {
      text-align: center;
      margin: 20px 0;
      .setborder {
        background: #ff7819;
        border-radius: 4px;
        font-size: 14px;
        color: #ffffff;
      }
    }
  }
}

.informationaa {
  width: 100%;
  margin: 0 auto 20px;
  font-size: 12px;
  position: relative;
}

.selects {
  width: 396px;
}

.dateinp {
  font-size: 12px;
  width: 170px;
}

.line {
  text-align: center;
}

.sscheckbox {
  position: absolute;
  left: 385px;
  top: 0;
  height: 100%;
  width: 80px;
}

.informations {
  margin-bottom: 0;
}

.app-container .app-box .p-detail .texts {
  width: 328px;
  font-size: 13px;
  color: #cbcbcb;
  letter-spacing: 0;
  text-align: left;
  text-indent: 0;
  line-height: 28px;

  .icon-xuanzhong {
    color: #ff7819;
    font-size: 8px;
  }
  span {
    color: #1989fa;
  }
}
.line {
  text-align: center;
}
.informationdd {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
  padding-top: 10px;
}

.btn {
  display: block;
  margin-left: -120px;
}

.tecenter td {
  text-align: center;
  height: 44px;
}

.tecenter .operation_btn {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  span {
    margin-right: 10px;
    font-size: 13px;
    color: #027dca;
    cursor: pointer;
  }
}

.upname {
  color: red;
}

.downname {
  color: #027dca;
}
.downnames {
  cursor: pointer;
}
.setc {
  text-align: center;
  font-size: 12px;
  color: #333333;
}

.btnsetc {
  justify-content: center;
  margin-left: 0;
  position: relative;
  a:not(:first-of-type) {
    margin-left: 12px;
  }
  .Proportionedit_delete {
    position: absolute;
    width: 250px;
    top: 100%;
    left: -80px;
    background: red;
  }
  .Proportionedit {
    position: absolute;
    width: 420px;
    height: 164px;
    top: 100%;
    right: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    z-index: 33;
    padding: 10px 0 10px 0;
    .Proportionedit_top {
      width: 100%;
      height: 93px;
      display: flex;
      margin-bottom: 20px;
      .Proportionedit_left {
        width: 50%;
        height: 100%;
        display: flex;
        justify-content: flex-start;
        flex-direction: column;
        align-items: center;
        .Proportionedit_title {
          width: 100%;
          font-size: 14px;
          color: #40819e;
          margin: 0;
          height: 22px;
          margin-bottom: 11px;
          text-align: center;
        }
        .Proportionedit_name {
          width: 100%;
          display: flex;
          justify-content: space-around;
          align-items: center;
          height: 22px;
          margin-bottom: 5px;
          font-size: 13px;
          color: #666666;
          .Proportionedit_inp {
            width: 50px;
            font-size: 12px;
            color: #333333;
            height: 22px;
            text-align: center;
            outline: none;
            border: 1px solid #dcdfe6;
            border-radius: 4px;
          }
        }
        .actives {
          .Proportionedit_inp {
            border: 1px solid red;
          }
        }
        .activess {
          .Proportionedit_inp {
            border: 1px solid red;
          }
        }
      }
    }
    .Proportionedit_btn {
      width: 100%;
      height: 28px;
      margin-top: 27px;
      display: flex;
      justify-content: flex-end;
      align-items: center;
      button {
        background: #f7f7f7;
        border: 1px solid #dddddd;
        border-radius: 5px;
        width: 50px;
        height: 28px;
        margin-left: 20px;
        cursor: pointer;
      }
      .surebtn {
        background: #ff7819;
        border: 1px solid #ee6000;
        border-radius: 5px;
        outline: none;
        color: #ffffff;
      }
    }
  }
}

.daos {
  color: #95bacc;
  margin: 0 3px;
}
.describe_text {
  margin: 0;
  line-height: 20px;
}
.app-container .policyupper3c .p-detail .dialog-tit {
  font-size: 14px !important;
}
.Percentage_color {
  color: #999;
}
.tables {
  width: 100%;
  min-width: 940px;
  margin-top: 30px;
  box-sizing: border-box;
  .tables_top {
    width: 100%;
    height: 80px;
    background: #334750;
    color: #ffffff;
    font-size: 14px;
    .tables_top1 {
      width: 35%;
      height: 80px;
      line-height: 80px;
      text-indent: 49px;
      float: left;
      .tablestop_dir {
        margin-left: 40px;
      }
    }
    .tables_topall {
      width: 53%;
      float: left;
      .tables_top2 {
        float: left;
        width: 26.2%;
        height: 80px;
        line-height: 80px;
        border-left: 1px solid #e8e8e8;
        text-align: center;
      }
      .tables_top3 {
        float: left;
        width: 73.8%;
        height: 80px;
        border-right: 1px solid #e8e8e8;
        border-left: 1px solid #e8e8e8;
        .tables_top3_top {
          width: 100%;
          height: 50%;
          border-bottom: 1px solid #e8e8e8;
          span {
            width: 40%;
            height: 100%;
            line-height: 40px;
            text-align: center;
            display: block;
            float: left;
          }
          .tables_top3_frame {
            border-right: 1px solid #e8e8e8;
             span{
            	width:50%;
            }
          }
          .tables_top3_che{
          	 width: 20%;
          	  span{
            	width:100%;
            }
          }
        }
        .tables_top3_bom {
          width: 100%;
          height: 50%;
          span {
            width: 40%;
            height: 100%;
            line-height: 40px;
            text-align: center;
            display: block;
            float: left;
          }
          .tables_top3_frame {
            border-right: 1px solid #e8e8e8;
            span{
            	width:50%;
            }
          }
           .tables_top3_che{
          	 width: 20%;
          	  span{
            	width:100%;
            }
          }
        }
      }
    }

    .tables_top4 {
      float: left;
      height: 80px;
      width: 12%;
      line-height: 80px;
      text-align: center;
    }
  }
  .tables_content {
    width: 100%;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    // background: #fafafa;
    border-bottom: 1px solid #e8e8e8;
    .tables_content1 {
      width: 35%;
      float: left;
      height: 100%;
      // text-indent: 10px;
      position: relative;
      padding: 0 10px 0 102px;
      min-height: 45px;

      i {
        color: #606266;
        position: absolute;
        left: 10px;
        top: 16px;
        cursor:pointer;
      }
      .tablescont_num {
        color: #666666;
        position: absolute;
        left: 49px;
        top: 17px;
      }
      .tablescont_num2{
					color: #666666;
					position: absolute;
					left: 40px;
					top: 10px;
				}
      .tablescont_dis {
        color: #333333;
        font-weight: 700;
        display: table-cell;
        vertical-align: middle;
        line-height: 20px;
        height: 45px;
      }
    }
    .tables_content1:after {
      display: block;
      width: 1px;
      height: 100%;
      position: absolute;
      right: -1px;
      top: 0;
      background: #e8e8e8;
      content: "";
    }
    .tables_contentall {
      float: left;
      width: 53%;
      .tables_contentall_in:last-child {
        border-bottom: 0;
      }
      .tables_contentall_in {
      	width:100%;
        border-bottom: 1px solid #e8e8e8;

        .tables_content2 {
          position: relative;
          i {
            display: none;
            position: absolute;
            right: 6px;
            top: 0px;
            cursor: pointer;
            font-size: 13px;
          }
          .icon-plus {
            color: #019f6c;
          }
          .icon-shanchu {
            color: #cf1322;
            font-size: 15px;
          }
          &:hover {
            i {
              display: block;
            }
          }
          width: 26.2%;
          float: left;
          height: 45px;
          border-left: 1px solid #e8e8e8;
          line-height: 45px;
          text-align: center;
          padding: 0 18px;
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
        }

        .tables_content3 {
          width: 73.8%;
          float: left;
          height: 45px;
          border-left: 1px solid #e8e8e8;
          border-right: 1px solid #e8e8e8;
          position: relative;
          .tables_content3_inp {
            width: 40%;
            height: 100%;
            line-height: 45px;
            text-align: center;
            display: block;
            float: left;
            .tables_content3_inpin {
              display: block;
              float: left;
              width: 50%;
              height: 100%;
              line-height: 45px;
              text-align: center;
              .inputset {
                width: 50px;
                height: 22px;
                outline: none;
                background: #ffffff;
                border: 1px solid #cbcbcb;
                border-radius: 4px;
                text-align: right;
                padding-right: 5px;
              }
              .isfrontshow,
              .isseconshow {
                border: 1px solid red !important;
              }
              .isdis {
                background-color: #f5f7fa;
                border-color: #e4e7ed;
                color: #c0c4cc;
                cursor: not-allowed;
                color: #333;
              }
            }
          }
          .tables_content3_che{
          	width:20%;
          	.tables_content3_inpin{
          		width:100%;
          	}
          }
          .ischange1 input {
            border: 1px solid #ff9430 !important;
          }
          .ischange2 .inputset {
            border: 1px solid #ff9430 !important;
          }
          .ischange3 .inputset {
            border: 1px solid #ff9430 !important;
          }
          .ischange4 .inputset {
            border: 1px solid #ff9430 !important;
          }
					.ischange5 .inputset {
            border: 1px solid #ff9430 !important;
          }
          .tables_top3_frame {
            border-right: 1px solid #e8e8e8;
          }
        }
        .backshows {
          background: rgba(249, 225, 202, 0.5);
        }
      }
    }

    .tables_content4 {
      width: 12%;
      float: left;
      min-height: 45px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #027dca;
      .tablescont_right_edit {
        margin: 0 10px;
      }
      .tablescont_right_delete {
        color: red;
      }
    }
  }
  .tables_content:nth-child(odd) {
    background: #fafafa;
  }
  .tables_content:nth-child(even) {
    background: #fff;
  }
  .tables_bom {
    width: 100%;
    height: 45px;
    border-bottom: 1px solid #e8e8e8;
    line-height: 45px;
    color: #027dca;
    .tables_bom_left {
      width: 35%;
      height: 100%;
      float: left;
      font-size: 14px;

      text-indent: 10px;
      span {
        cursor: pointer;
      }
    }
    .tables_bom_son {
      width: 13.9%;
      float: left;
      border-left: 1px solid #e8e8e8;
      text-align: center;
      span {
        cursor: pointer;
      }
    }
    .tables_bom_cen {
      width: 34%;
      height: 100%;
      float: left;
      border-right: 1px solid #e8e8e8;
      border-left: 1px solid #e8e8e8;
      box-sizing: border-box;
      text-align: center;
      span {
        cursor: pointer;
      }
      .havemaoe {
        color: #999;
      }
    }
    .tables_bom_right {
      width: 12%;
      height: 100%;
      float: left;
    }
  }
}
.addson {
  margin-left: 21px;
}
.shoedetails {
  width: 100%;
  border-top: 1px solid #e8e8e8;
  margin-bottom: 10px;
   .detail_left {
        width: 100%;
        float: left;
        border-right: 1px solid #e8e8e8;
        box-sizing: content-box;
        .detailname {
           color: #333;
          font-weight: 500;
          width: 153px;
          min-width: 153px;
          text-indent: 91px;
          height: 10px;
          height: 35px;
          line-height: 35px;
          margin: 0;
          padding: 0;
        }
        .detailCon{
          width:180%;
          -moz-column-count:2; /* Firefox */
          -webkit-column-count:2;
          column-count: 2;
          -moz-column-gap:0; /* Firefox */
          -webkit-column-gap:0;
          column-gap: 0;
        }
        .detailconytent {
          width: 96%;
          min-height: 22px;
          // float: left;
           font-family: PingFangSC-Regular;
            font-size: 13px;
            color: #666666;
          // border-top: 1px solid #ebebeb;
          p {
            float: left;
            word-break: break-all;
            line-height: 35px;
            min-height: 22px;
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            padding:0 0px;
            padding-left: 7px;
          }
          .spanname {
            width: 108px;
            text-align: left;
            // text-indent: 10px;
            img{
              width: 9px;
              margin-left: 5px;
              margin-right:5px;
            }
            // border-right: 1px solid #ebebeb;
          }
          .spantext {
            width: 70%;
             min-width: 235px;
            // border-left: 1px solid #ebebeb;
            margin-left: -1px;
            color: #151515;
              break-inside: avoid;
          }
        }
        .detailconytent:last-child {
          // border-bottom: 1px solid #e8e8e8;
        }
      }

        @media screen and (min-width: 0) and (max-width: 1430px) {
          .detailconytent{
            width: 126% !important;
          }
          .spantext {
            width: 80%;
             max-width: 255px;
            // border-left: 1px solid #ebebeb;
                break-inside: avoid;
            margin-left: -1px;
            color: #151515;
          }
         .tables .tables_cont .shoedetails .detail_right .detailconytent .spanname{
           width: 31% !important;
         }
        }

      .detail_right {
        width: 100%;
        float: left;
        height: 100%;
        // border-left: 1px solid #e8e8e8;
        margin-left: -1px;
        box-sizing: content-box;
        .detailname {
           color: #333;
          font-weight: 500;
          width: 153px;
           min-width: 153px;
          text-indent: 91px;
          height: 10px;
          height: 35px;
          line-height: 35px;
          margin: 0;
          padding: 0;
        }
        .detailCon{
          width:180%;
          -moz-column-count:2; /* Firefox */
          -webkit-column-count:2;
          column-count: 2;
          -moz-column-gap:0; /* Firefox */
          -webkit-column-gap:0;
          column-gap: 0;
        }
        .detailconytent {
          width: 96%;
          min-height: 35px;
          // float: left;
          font-family: PingFangSC-Regular;
            font-size: 13px;
            color: #666666;
          // border-top: 1px solid #ebebeb;
          p {
            float: left;
            word-break: break-all;
            line-height: 35px;
            min-height: 22px;
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            padding:0 0px;
            padding-left: 7px;
          }
          .spanname {
             width: 108px;
            text-align: left;
            // text-indent: 10px;
            img{
              width: 9px;
              margin-left: 5px;
              margin-right:5px;
            }
            // border-right: 1px solid #ebebeb;
          }
          .spantext {
           width: 71%;
           min-width: 235px;
            // border-left: 1px solid #ebebeb;
            margin-left: -1px;
                break-inside: avoid;
            color: #151515;
          }
        }
        .detailconytent:last-child {
          // border-bottom: 1px solid #e8e8e8;
        }
      }
}
.adoptorreject {
  width: 100%;
  height: 225px;
  background: #fafafa;
  border: 1px solid #d9d9d9;
  border-radius: 5px;
  padding: 20px;
  text-align: left;
  padding-top: 1px;
  .adoptdis {
    width: 100%;
    font-size: 14px;
    color: #333333;
    font-weight: 700;
  }
  .adoptresult {
    width: 100%;
    min-height: 20px;
    line-height: 20px;
    margin-top: 20px;
    p {
      width: 70px;
      margin: 0;
      padding: 0;
      margin-right: 10px;
      float: left;
    }
    div {
      float: left;
    }
  }
}
.adoptresultbom {
  width: calc(100% - 80px);
}
.adoptsub {
  display: block;
  margin: 20px auto 0;
  width: 120px;
}
.Dismissal {
  width: 100%;
  height: 28px;
  background: #fef1f1;
  border-radius: 5px;
  font-size: 13px;
  color: #cf1322;
  margin-bottom: 22px;
  line-height: 28px;
  text-indent: 30px;
}
.backshows:hover .poper_operation {
  display: block;
}
.poper_operation {
  position: absolute;
  top: 0;
  right: -100px;
  width: 100px;
  height: 40px;
  margin-top: 2.5px;
  background: #fcf0e3;
  border: 1px solid #ebeef5;
  color: #027dca;
  text-align: center;
  cursor: pointer;
  font-size: 13px;
  display: none;
  line-height: 40px;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.2);

  span:first-child {
    margin-right: 15px;
  }
}
.poper_operation::after {
  width: 6px;
  height: 6px;
  position: absolute;
  top: 50%;
  margin-top: -6px;
  display: block;
  content: "";
  left: -6px;
  width: 0;
  height: 0;
  border-width: 6px 6px 6px 0;
  border-style: solid;
  border-color: transparent #fcf0e3 transparent transparent; /*透明 灰 透明 透明 */
}
.nodata {
  margin-top: 10px;
  width: 100%;
  height: 30px;
  line-height: 30px;
  text-align: center;
}
.toblue {
  color: #0099ff;
  display: inline;
}
.visi-list {
  width: 100%;
  max-height: 300px;
  border: 1px solid #eee;
  border-bottom: 0;
  overflow-y: auto;
  box-sizing: border-box;
  div {
    width: 50%;
    height: 40px;
    float: left;
    border-bottom: 1px solid #eee;
    line-height: 40px;
  }
  .list_name {
    text-indent: 20px;
    border-right: 1px solid #eee;
  }
  .list_time {
    text-indent: 20px;
  }
}
.dialog-tit {
  font-size: 14px !important;
}
</style>
<style type="text/css">
.toDis-dialog2 .el-row {
  margin-left: 0 !important;
  margin-right: 0 !important;
}
.toDis-dialog2 .el-form-item__content {
  margin-left: 0 !important;
  text-align: center;
}
.toDis-dialog2 .dialog-sec-wp {
  margin-left: 0 !important;
}

.isNull{
    color: #999 !important;
  }


  .iIcon{
		display: none;
	}
	.spanhover{
		cursor: pointer;
		color:#027dca;
		border-bottom:1px solid #027dca;
	}
	.selectIndex{
		width:55px;
	}
	.tablescont_num:hover .iIcon{
		display: inline;
		color:#027dca;
		cursor: pointer;
	}
</style>